Persist and rehydrate your Vuex state between page reloads. New plugin instances can be created in separate files, but must be imported and added to plugins object in the main Vuex file. It is possible to use vuex-persistedstate with Nuxt.js. It must be included as a NuxtJS plugin. Provides an array of any paths to partially persist the state. If no paths are given, the complete state is persisted. If an empty array is given, no state is persisted. Paths must be specified using dot notation. If using modules, include the module name. If it's not ideal to have the state of the Vuex store inside local storage, one can easily implement the functionality to use cookies for that (or any other you can think of). Any object following the Storage protocol (getItem, setItem, removeItem, etc) could be passed. If you need to use Local Storage (or you want to) but want to prevent attackers from easily inspecting the stored data, you can obfuscate it.
Features
- The UMD build is also available on unpkg
- New plugin instances can be created in separate files
- It is possible to use vuex-persistedstate with Nuxt.js
- Options provided to configure the plugin for your specific needs
- Reduce the state to persist based on the given paths
- Setup mutation subscription