pinia-plugin-persistedstate-2
March 8, 2025 ยท View on GitHub
Persist and rehydrate your Pinia state between page reloads.
Features
- ๐จ Configurable globally and in every store.
- ๐ช Type Safe
- ๐ฆ Extremely small
๐ Getting Started
Installation
# or pnpm or yarn
npm install pinia-plugin-persistedstate-2
Usage
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistedStatePlugin } from 'pinia-plugin-persistedstate-2'
import App from './App.vue'
const pinia = createPinia()
const persistedStatePlugin = createPersistedStatePlugin({
// plugin options goes here
})
pinia.use(persistedStatePlugin)
const app = createApp(App)
app.use(pinia)
app.mount('#app')
More examples can be found in the examples folder.
API can be found in the type file.
๐ค Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details