dehydrate
functionsignature
dehydrate(store, options): stringSerializes a store for handoff, for example from a server render to the client.
Parameters
| Name | Type | Description |
|---|---|---|
store | Pick<PersistableStore, "getState"> |
| Name | Type | Description |
|---|---|---|
options | Pick<PersistOptions, "version" | "slices" | "onError" | "maxNodes"> |
Returns
string, The payload, or "" when the state exceeded PersistOptions.maxNodes. An empty
handoff hydrates as "nothing to restore", so the client starts from its defaults rather than
from part of the server's state. The loss is reported through onError either way.