https://github.com/soc221b/pinia-plugin-persistedstate-2
Persist and rehydrate your Pinia state between page reloads.
https://github.com/soc221b/pinia-plugin-persistedstate-2
async localforage localstorage pinia plugin storage vue
Last synced: about 1 year ago
JSON representation
Persist and rehydrate your Pinia state between page reloads.
- Host: GitHub
- URL: https://github.com/soc221b/pinia-plugin-persistedstate-2
- Owner: soc221b
- License: mit
- Created: 2021-12-04T15:05:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-14T07:32:14.000Z (about 1 year ago)
- Last Synced: 2025-05-14T08:39:17.393Z (about 1 year ago)
- Topics: async, localforage, localstorage, pinia, plugin, storage, vue
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/pinia-plugin-persistedstate-2
- Size: 15.9 MB
- Stars: 106
- Watchers: 2
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pinia-plugin-persistedstate-2
Persist and rehydrate your Pinia state between page reloads.
[](https://github.com/soc221b/pinia-plugin-persistedstate-2/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/pinia-plugin-persistedstate-2)
Features
- 🎨 Configurable globally and in every store.
- 💪 Type Safe
- 📦 Extremely small
## 🚀 Getting Started
### Installation
```sh
# or pnpm or yarn
npm install pinia-plugin-persistedstate-2
```
### Usage
```ts
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](./examples) folder.
API can be found in the [type](./src/type.ts) file.
## 🤝 Contributing
Please read [CONTRIBUTING.md](/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](/LICENSE) file for details