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

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow vuex-persistedstate

vuex-persistedstate Web Site

nel_h2
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of vuex-persistedstate!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript User Interface (UI) Software, JavaScript Browser Extensions and Plugins

Registered

2021-10-25