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

Function setStateWithReconciliation

packages/solid-query/src/useBaseQuery.ts:215–228  ·  view source on GitHub ↗

* Writes an observer result into the store, applying the query's `reconcile` option. * @param res - The observer result to write.

(res: typeof observerResult)

Source from the content-addressed store, hash-verified

213 * @param res - The observer result to write.
214 */
215 function setStateWithReconciliation(res: typeof observerResult) {
216 const opts = observer().options
217 // @ts-expect-error - Reconcile option is not correctly typed internally
218 const reconcileOptions = opts.reconcile
219
220 setState((store) => {
221 return reconcileFn(
222 store,
223 res,
224 reconcileOptions === undefined ? false : reconcileOptions,
225 opts.queryHash,
226 )
227 })
228 }
229
230 /**
231 * Creates the signal used as the resource's storage, backed by the query store. Hydration data is

Callers 3

createDeepSignalFunction · 0.85
useBaseQueryFunction · 0.85
onHydratedFunction · 0.85

Calls 1

reconcileFnFunction · 0.85

Tested by

no test coverage detected