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

Q: StorageObject not working. #294

Closed AdminDev826 closed 5 years ago

AdminDev826 commented 6 years ago

I have created StorageObject for sobject

s_object: storageFor('sobject'),
...
this.set('s_object', {'a','b'}); ----> It seems not saved to storage.
richard-viney commented 5 years ago

The set() call there is replacing the entire value of this.s_object. Try calling set() or setProperties() on the storage object instead, e.g. this.s_object.setProperties({ a: 'value', b: 'value2' }).

fsmanuel commented 5 years ago

@AdminDev826 I'm closing this. If you still need help please reopen the issue.