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

Method #notify

packages/query-core/src/queriesObserver.ts:271–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269 }
270
271 #notify(): void {
272 if (this.hasListeners()) {
273 const previousResult = this.#combinedResult
274 const newTracked = this.#trackResult(this.#result, this.#observerMatches)
275 const newResult = this.#combineResult(newTracked, this.#options?.combine)
276
277 if (previousResult !== newResult) {
278 notifyManager.batch(() => {
279 this.listeners.forEach((listener) => {
280 listener(this.#result)
281 })
282 })
283 }
284 }
285 }
286}
287
288type QueryObserverMatch = {

Callers 2

setQueriesMethod · 0.95
#onUpdateMethod · 0.95

Calls 4

#trackResultMethod · 0.95
#combineResultMethod · 0.95
hasListenersMethod · 0.80
listenerFunction · 0.50

Tested by

no test coverage detected