0.2.4 â€ĸ Published 3 months ago

pinia-plugin-persistedtauri v0.2.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

✨ Quickstart

🚚 Install

# npm
npm install --save pinia-plugin-persistedtauri

# yarn
yarn add pinia-plugin-persistedtauri

🛠 Configuration

import {createPinia} from 'pinia'
import {createPersistedState} from 'pinia-plugin-persistedtauri'

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

⚙ī¸ Options

You can do nothing and the persistent save will work automatically, but you can also do some configuration.

defineStore('main', {
  state: () => ({
    count: 0,
  }),
  persist: true, // default: true
})
// use false to disable persist
persist: boolean | PersistedTauriOptions

type PersistedTauriOptions = {
  // The file name or key name of the data is stored by default, using the store ID
  name?: string,
  // Customizing storage mode, compatible with localStorage and sessionStorage
  storage?: AsyncStorage | Storage,
  // Customizing the way data is serialized and deserialized
  serializer?: StateSerializer,
}

🗝ī¸ License

MIT LICENSE

0.2.1

3 months ago

0.2.3

3 months ago

0.2.2

3 months ago

0.2.4

3 months ago

0.1.0

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago