Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/framework/react/plugins/createAsyncStoragePersister.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ interface CreateAsyncStoragePersisterOptions {
* pass a time in ms to throttle saving the cache to disk */
throttleTime?: number
/** How to serialize the data to storage */
serialize?: (client: PersistedClient) => string
serialize?: (client: PersistedClient) => MaybePromise<string>
/** How to deserialize the data from storage */
deserialize?: (cachedString: string) => PersistedClient
deserialize?: (cachedString: string) => MaybePromise<PersistedClient>
/** How to retry persistence on error **/
retry?: AsyncPersistRetryer
}
Expand All @@ -108,6 +108,8 @@ interface AsyncStorage<TStorageValue = string> {
}
```

The `serialize` and `deserialize` callbacks can return their results synchronously or asynchronously as promises.

The default options are:

```tsx
Expand Down