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

Function createDeepSignal

packages/solid-query/src/useBaseQuery.ts:204–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 }
203
204 function createDeepSignal<T>(): Signal<T> {
205 return [
206 () => state,
207 (v: any) => {
208 const unwrapped = unwrap(state)
209 if (typeof v === 'function') {
210 v = v(unwrapped)
211 }
212 // Hydration data exists on first load after SSR,
213 // and should be removed from the observer result
214 if (v?.hydrationData) {
215 const { hydrationData, ...rest } = v
216 v = rest
217 }
218 setStateWithReconciliation(v)
219 },
220 ] as Signal<T>
221 }
222
223 /**
224 * Unsubscribe is set lazily, so that we can subscribe after hydration when needed.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…