Vuex Persist State 🔄
A Vuex plugin to backup and restore stores state to browsers localstorage.
Features
- Throttles localstorage updates to perserve performance
- Automatic or manual restoration of state
- No dependencies
- Tiny (382B gzip)
Getting Started
Add the plugin to the store for automatic backup and restore.
; const store = // ... plugins:
Configuration
The plugin takes a configuration object:
Manual Restore
For control over when state gets restored:
; const store = // ... plugins: // Call the folling function to restore.// This is typically done in the router before any new actions // trigger state in the localstorage to be overwritten.storepersist;
License
MIT