File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ interface CreateAsyncStoragePersistorOptions {
6060 /** To avoid localstorage spamming,
6161 * pass a time in ms to throttle saving the cache to disk */
6262 throttleTime? : number
63+ /** How to serialize the data to storage */
64+ serialize? : (client : PersistedClient ) => string
65+ /** How to deserialize the data from storage */
66+ deserialize? : (cachedString : string ) => PersistedClient
6367}
6468
6569interface AsyncStorage {
@@ -75,5 +79,7 @@ The default options are:
7579{
7680 key = ` REACT_QUERY_OFFLINE_CACHE` ,
7781 throttleTime = 1000 ,
82+ serialize = JSON .stringify ,
83+ deserialize = JSON .parse ,
7884}
7985```
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ interface CreateWebStoragePersistorOptions {
5757 /** To avoid spamming,
5858 * pass a time in ms to throttle saving the cache to disk */
5959 throttleTime? : number
60+ /** How to serialize the data to storage */
61+ serialize? : (client : PersistedClient ) => string
62+ /** How to deserialize the data from storage */
63+ deserialize? : (cachedString : string ) => PersistedClient
6064}
6165```
6266
@@ -66,5 +70,7 @@ The default options are:
6670{
6771 key = ` REACT_QUERY_OFFLINE_CACHE` ,
6872 throttleTime = 1000 ,
73+ serialize = JSON .stringify ,
74+ deserialize = JSON .parse ,
6975}
7076```
You can’t perform that action at this time.
0 commit comments