Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PersistOptions<S>

Type parameters

  • S

Hierarchy

  • PersistOptions

Implemented by

Index

Properties

Optional asyncStorage

asyncStorage: undefined | false | true

If your storage is async i.e., if setItem(), getItem() etc return Promises (Must be used for asynchronous storages like LocalForage)

default

false

Optional filter

filter: undefined | function

Method to filter which mutations will trigger state saving Be default returns true for all mutations. Check mutations using mutation.type

param

object of type {@link Payload}

Optional key

key: undefined | string

Key to use to save the state into the storage

Optional modules

modules: string[]

Names of modules that you want to persist. If you create your custom PersistOptions.reducer function, then that will override filter behaviour, not this argument

Optional reducer

reducer: undefined | function

Function to reduce state to the object you want to save. Be default, we save the entire state. You can use this if you want to save only a portion of it.

param

Optional restoreState

restoreState: undefined | function

Method to retrieve state from persistence

param
param

Optional saveState

saveState: undefined | function

Method to save state into persistence

param
param
param

Optional storage

storage: Storage | AsyncStorage

Window.Storage type object. Default is localStorage

Optional strictMode

strictMode: undefined | false | true

Set this to true to support Vuex Strict Mode

default

false

Optional supportCircular

supportCircular: undefined | false | true

Support serializing circular json objects

  let x = {a: 10}
  x.b = x
  console.log(x.a) // 10
  console.log(x.b.a) // 10
  console.log(x.b.b.a) // 10
default

false

Generated using TypeDoc