MCPcopy Create free account
hub / github.com/TanStack/query / persistQueryClientSave

Function persistQueryClientSave

packages/query-persist-client-core/src/persist.ts:169–182  ·  view source on GitHub ↗
({
  queryClient,
  persister,
  buster = '',
  dehydrateOptions,
}: PersistedQueryClientSaveOptions)

Source from the content-addressed store, hash-verified

167 * `dehydrateOptions`.
168 */
169export async function persistQueryClientSave({
170 queryClient,
171 persister,
172 buster = '',
173 dehydrateOptions,
174}: PersistedQueryClientSaveOptions) {
175 const persistClient: PersistedClient = {
176 buster,
177 timestamp: Date.now(),
178 clientState: dehydrate(queryClient, dehydrateOptions),
179 }
180
181 await persister.persistClient(persistClient)
182}
183
184/**
185 * Subscribe to QueryCache and MutationCache updates (for persisting).

Calls 1

dehydrateFunction · 0.90

Tested by

no test coverage detected