From 774f92717ae2dd29f7fcc7e18f2ef8246e4c621b Mon Sep 17 00:00:00 2001 From: grzdev Date: Sun, 6 Sep 2026 01:19:32 +0100 Subject: [PATCH] docs(persister): document asynchronous serialization callbacks --- docs/framework/react/plugins/createAsyncStoragePersister.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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