The best persistence plugin for pinia.
Tip
The persistence logic of this plugin is implemented based on unstorage, which provide unified key-value storage API. Based on this, you can even persist the data to the database
pnpm add pinia-plugin-unstorage
import { createPinia } from 'pinia' import { createPiniaUnstorage } from 'pinia-plugin-unstorage' const pinia = createPinia() pinia.use(createPiniaUnstorage({ // UnstorageOptions }))
export default defineNuxtConfig({ modules: ['@pinia/nuxt', 'pinia-plugin-unstorage/nuxt'], piniaUnstorage: { // UnstorageOptions }, })
interface UnstorageOptions { namespace: string // prefix str to as storage key driver: Driver // the storage instance in unstorage }
export const useStore = defineStore('store', () => { // ... }, { unstorage: { pick: [], // string[], state keys picked to storage omit: [] // string[], state keys omitted fot storage } })
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4