Skip to content

PersistConfig

PersistConfig<TState> = object

Defined in: types.ts:62

Configuration for persisting store state to a storage backend.

TState

optional deserialize?: (value) => unknown

Defined in: types.ts:74

Custom deserializer. Defaults to JSON.parse.

string

unknown


optional migrate?: MigrationMap<TState>

Defined in: types.ts:68

Migrations from older versions to the current version.


optional partialize?: (state) => Partial<TState>

Defined in: types.ts:70

Keys to include in persistence. If omitted, the entire state is persisted.

TState

Partial<TState>


optional serialize?: (value) => string

Defined in: types.ts:72

Custom serializer. Defaults to JSON.stringify.

unknown

string


optional storage?: StorageBackend

Defined in: types.ts:64

Storage backend. Defaults to "local" in browsers, "memory" in Node.


optional version?: number

Defined in: types.ts:66

Schema version. Increment when state shape changes.