hydrate
functionsignature
hydrate(options): Promise<Hydration>Reads persisted state, ready to seed a store.
Parameters
| Name | Type | Description |
|---|---|---|
options | PersistOptions & { source?: string } |
Returns
Promise<Hydration>
Example
example
const hydration = await hydrate({ key: 'app', adapter, version: 3 });
const store = createStore({
name: 'App',
reducer: withHydration({ todos: todosSpec }, hydration),
});