MCPcopy Index your code
hub / github.com/TanStack/query / persistQueryClientSave

Function persistQueryClientSave

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

Source from the content-addressed store, hash-verified

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

Calls 1

dehydrateFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…