MCPcopy
hub / github.com/TanStack/query / #combineResult

Method #combineResult

packages/query-core/src/queriesObserver.ts:212–233  ·  view source on GitHub ↗
(
    input: Array<QueryObserverResult>,
    combine: CombineFn<TCombinedResult> | undefined,
  )

Source from the content-addressed store, hash-verified

210 }
211
212 #combineResult(
213 input: Array<QueryObserverResult>,
214 combine: CombineFn<TCombinedResult> | undefined,
215 ): TCombinedResult {
216 if (combine) {
217 if (
218 !this.#combinedResult ||
219 this.#result !== this.#lastResult ||
220 combine !== this.#lastCombine
221 ) {
222 this.#lastCombine = combine
223 this.#lastResult = this.#result
224 this.#combinedResult = replaceEqualDeep(
225 this.#combinedResult,
226 combine(input),
227 )
228 }
229
230 return this.#combinedResult
231 }
232 return input as any
233 }
234
235 #findMatchingObservers(
236 queries: Array<QueryObserverOptions>,

Callers 2

getOptimisticResultMethod · 0.95
#notifyMethod · 0.95

Calls 1

replaceEqualDeepFunction · 0.90

Tested by

no test coverage detected