La referencia de la API está disponible solo en inglés por ahora.

persist

function
persistence/persist.ts:298
signature
persist(store, options): () => Promise<void>

Writes state as it changes.

Parameters

NameTypeDescription
storePersistableStore
NameTypeDescription
optionsPersistOptions

Returns

() => Promise<void>, A function that stops persisting, flushes anything pending, and returns a promise that resolves once the last write has settled. Await it before tearing the store down: with an asynchronous adapter the final write is otherwise still in flight. It never rejects; a failed write is reported through onError.