Thanks for your input, @dknutsen.
runspired on the Slack channel gave me some help, and ultimately the reality of the the
DS.Store#unloadAll being unreliable when trying to use it for specific models (e.g.,
unloadAll('model-name')). He said there are only two ways to produce the outcome I was desiring, and they were:
- Figure out how to disconnect the records of interest from all other models. In other words, remove all references to the records so that it can be garbage collected.
- Unload all the models in the store (e.g., simply call
I opted for the latter as it was the most simplest approach for the time-being, and the case in which I’m using it is pretty isolated. However, I imagine this wouldn’t be the most efficient solution for other people.
To further ensure my app would produce the desired results, I wrapped the
unloadAll() call in an
store.unloadAll(); // UNLOAD ALL THE THINGS!