diff --git a/docs/framework/react/plugins/createAsyncStoragePersister.md b/docs/framework/react/plugins/createAsyncStoragePersister.md index 671ac3a4672..d67e3f74fe3 100644 --- a/docs/framework/react/plugins/createAsyncStoragePersister.md +++ b/docs/framework/react/plugins/createAsyncStoragePersister.md @@ -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 /** How to deserialize the data from storage */ - deserialize?: (cachedString: string) => PersistedClient + deserialize?: (cachedString: string) => MaybePromise /** How to retry persistence on error **/ retry?: AsyncPersistRetryer } @@ -108,6 +108,8 @@ interface AsyncStorage { } ``` +The `serialize` and `deserialize` callbacks can return their results synchronously or asynchronously as promises. + The default options are: ```tsx