Skip to content

Instantly share code, notes, and snippets.

@PierBover
Created November 11, 2018 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierBover/9a5899732e4cfdf931e6f41c3ade743e to your computer and use it in GitHub Desktop.
Save PierBover/9a5899732e4cfdf931e6f41c3ade743e to your computer and use it in GitHub Desktop.
var persistentStore = {
state: JSON.parse(localStorage.getItem('persistent-state')),
save () {
localStorage.setItem('persistent-state', JSON.stringify(this.state));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment