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

Method #trackResult

packages/query-core/src/queriesObserver.ts:195–210  ·  view source on GitHub ↗
(
    result: Array<QueryObserverResult>,
    matches: Array<QueryObserverMatch>,
  )

Source from the content-addressed store, hash-verified

193 }
194
195 #trackResult(
196 result: Array<QueryObserverResult>,
197 matches: Array<QueryObserverMatch>,
198 ) {
199 return matches.map((match, index) => {
200 const observerResult = result[index]!
201 return !match.defaultedQueryOptions.notifyOnChangeProps
202 ? match.observer.trackResult(observerResult, (accessedProp) => {
203 // track property on all observers to ensure proper (synchronized) tracking (#7000)
204 matches.forEach((m) => {
205 m.observer.trackProp(accessedProp)
206 })
207 })
208 : observerResult
209 })
210 }
211
212 #combineResult(
213 input: Array<QueryObserverResult>,

Callers 2

getOptimisticResultMethod · 0.95
#notifyMethod · 0.95

Calls 2

trackResultMethod · 0.80
trackPropMethod · 0.80

Tested by

no test coverage detected