({
queryClient,
persister,
buster = '',
dehydrateOptions,
}: PersistedQueryClientSaveOptions)
| 111 | * - data is persisted using persister.persistClient |
| 112 | */ |
| 113 | export async function persistQueryClientSave({ |
| 114 | queryClient, |
| 115 | persister, |
| 116 | buster = '', |
| 117 | dehydrateOptions, |
| 118 | }: PersistedQueryClientSaveOptions) { |
| 119 | const persistClient: PersistedClient = { |
| 120 | buster, |
| 121 | timestamp: Date.now(), |
| 122 | clientState: dehydrate(queryClient, dehydrateOptions), |
| 123 | } |
| 124 | |
| 125 | await persister.persistClient(persistClient) |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Subscribe to QueryCache and MutationCache updates (for persisting) |
no test coverage detected