Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a persistent state option #5

Open
5 tasks
Andy-set-studio opened this issue Aug 8, 2018 · 2 comments
Open
5 tasks

Add a persistent state option #5

Andy-set-studio opened this issue Aug 8, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Andy-set-studio
Copy link
Owner

It could be handy for state to persist in local storage. This is especially true for small, PWAs.

Todos

  • Add constructor parameter
  • Feature detect that storage is available
  • Hydrate from local storage on instantiation if enabled
  • Self-subscribe to changes and automatically update storage
  • Add clear method if the local storage needs clearing for some reason
@Andy-set-studio Andy-set-studio added the enhancement New feature or request label Aug 8, 2018
@Andy-set-studio Andy-set-studio self-assigned this Aug 8, 2018
Andy-set-studio referenced this issue in Andy-set-studio/vanilla-js-state-management Aug 14, 2018
@MichaelFBA
Copy link

This would be a nice feature

@madeInLagny
Copy link

Hi, thanks for the great library. Has this persistent state enhancement been considered ?
I am working on a similar feature. The only piece I am missing is to identify which property of the state triggered the change to avoid having to save the whole state object at every update. Any ideas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants