ManuelDeLeon / viewmodel-react

Create your React components with view models.
MIT License
24 stars 3 forks source link

State preservation outside Meteor #33

Open antoninadert opened 6 years ago

antoninadert commented 6 years ago

For offline users, in your next version, what I would like is to be able to store data in localstorage instead of saving in in component state, so that VM restores the full previous state that was available automatically. I could chose to use or not this localstorage automatic loading We can already keep the state in URL so why not in localstorage ?

ManuelDeLeon commented 6 years ago

I'll revisit this one later on after the dust settles. I may end up adding an onLocalStorage option. No promises though.

In the meantime you can always use any of the many local storage libraries and save the component.data() in an autorun and loading it when the component is created.

antoninadert commented 6 years ago

what's up on this? :)