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

Models not persisting to local storage #284

Closed CodingItWrong closed 6 years ago

CodingItWrong commented 6 years ago

I'm attempting to get ember-local-storage working to store my Ember Data models locally, but the data doesn't seem to be persisting. I've created a demo project here:

https://github.com/CodingItWrong/ember-local-storage-troubleshooting

I believe the adapter and serializer are set up according to what the readme describes, but I don't see any entries in my browser's Local Storage:

screen shot 2018-05-07 at 11 29 11 am

And when I reload the app data isn't preserved.

Am I missing something obvious, or could there be a bug occurring in Ember 3.1.3?

CodingItWrong commented 6 years ago

I was missing something obvious; I wasn’t calling .save() on the record. Carry on!

fsmanuel commented 6 years ago

@CodingItWrong great that it works now!