Nomnom Pumpernickle Muffins

    This package has been deprecated

    Author message:

    Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

    pinia-persist-plugin
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    pinia-persist-plugin

    Opinionated persist plugin for pinia@next

    NPM version

    Get Started

    pnpm i pinia-persist-plugin

    Usage

    import { createApp } from 'vue'
    import { createPinia } from 'pinia'
    import { createPersistPlugin } from 'pinia-persist-plugin'
    
    const pinia = createPinia()
    const plugin = createPersistPlugin()
    pinia.use(plugin)
    
    const app = createApp(App)
    app.use(pinia)

    Configuration Options

    interface Options {
      storage?: Storage // where to store the persistent
      storageKey?: string // which key to persist the store state
      omits?: string[] | string // store id[s] to omit persist
    }
    
    // The default config is here
    const defaultOptions: Required<Options> = {
      storage: window.sessionStorage,
      storageKey: 'pinia-persist-plugin-state',
      omits: []
    }
    
    const plugin = createPersistPlugin(options?: Options)

    Example

    Can be accessed from playground folder

    Keywords

    none

    Install

    npm i pinia-persist-plugin

    DownloadsWeekly Downloads

    11

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    9.49 kB

    Total Files

    5

    Last publish

    Collaborators

    • guygubaby