0.1.1 • Published 2 years ago
pwp v0.1.1
pwp
Pinia with persistence.
Installation
Install with your favourite package manager:
# yarn
yarn add pwp
# pnpm
pnpm install pwp
# npm
npm install pwp
Import and install:
// main.js
import { createPinia } from 'pinia'
import { pwp } from 'pwp'
const pinia = createPinia()
pinia.use(pwp)
Enable the plugin per store:
import { defineStore } from 'pinia'
export const useStore = defineStore('...', {
persist: true,
state: () => ({ ... }),
actions: { ... },
getters: { ... }
})