funkensturm / ember-local-storage

The addon provides a storageFor computed property that returns a proxy and persists the changes to localStorage or sessionStorage. It ships with an ember-data adapter.
https://www.funkensturm.com/ember-local-storage/
MIT License
218 stars 76 forks source link

Re-saving index key #323

Open eg271 opened 3 years ago

eg271 commented 3 years ago

Using the LS adapter with Ember Data. On a fresh load, with records already saved in LS:

If I do localStorage.clear() and then save a record, both the record and the index key for that model type are saved to LS. If I repeat clearing and saving, the index key doesn´t save. Is there a way to force the index key to save - presume this is some sort of internal caching issue?

eg271 commented 3 years ago

More generally, the issue is how to update the LS to remove records that have had unloadRecord() called on them and so are no longer in the store