Persist a shopping cart so its contents survive page refreshes without a database call.
Keep a user's logged-in status in local storage so they don't get logged out on reload.
Save form progress to session storage so partially filled forms are not lost on accidental navigation.
Persist selected app preferences or theme settings across browser sessions.
Add one line to your Vuex store config. Works out of the box with localStorage. No longer actively maintained, evaluate alternatives for new projects.
This is a plugin for Vuex, which is the state management system used in Vue.js web applications. The problem it solves is simple: when a user refreshes a web page, all the in-memory data your app was holding (shopping cart contents, logged-in status, form progress) gets wiped. This library saves that data to the browser's local storage automatically so it survives page reloads, then restores it when the page loads again. The README opens with a clear notice that the project is no longer actively maintained. The author stopped working with Vue.js day-to-day and decided to stop spending personal time on it. The package remains available and usable, but no active support or updates should be expected. For developers who want to use it anyway, setup is a single line added to an existing Vuex store configuration. By default it saves the entire application state to local storage under the key "vuex". You can configure it to save only specific pieces of state using dot-notation path selectors, which is useful when you have large stores and only want to persist certain parts. Storage is configurable. Instead of local storage, you can point it at cookies, session storage, or any custom storage object that implements read and write methods. This makes it compatible with server-side rendering setups like Nuxt.js, where local storage is not available on the server. Other options let you filter which state mutations trigger a save, control how restored data merges with default state, encrypt stored values using third-party libraries, and run a callback once restoration is complete. The library works with both Vuex 4 (Vue 3) and older Vuex 3 (Vue 2) via a separate branch.
← robinvdvleuten on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.