1.0.0 • Published 3 years ago

pinap v1.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago

pinap

Persists pinia data in localStorage.

Installation

Install with your favourite package manager:

# yarn
yarn add pinap

# npm
npm i pinap

Import and install:

// main.ts
import { createPinia } from 'pinia'
import { pinap } from 'pinap'

const pinia = createPinia()
pinia.use(pinap)

Enable the plugin per store:

export const useStore = defineStore({
  id: '...',

  state: () => ({ ... }),

  actions: { ... },

  getters: { ... },

  persist: true
})

Credits

  • posva - For creating pinia.
  • Seb-L - For the code this is based off.

License

MIT

1.0.0

3 years ago