MCPcopy Create free account
hub / github.com/TanStack/query / #notify

Method #notify

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

Source from the content-addressed store, hash-verified

303 }
304
305 #notify(): void {
306 if (this.hasListeners()) {
307 const shouldSkipCombine = this.#shouldSkipCombine()
308 const previousResult = this.#combinedResult
309 const newResult = shouldSkipCombine
310 ? previousResult
311 : this.#combineResult(
312 this.#trackResult(this.#result, this.#observerMatches),
313 this.#options?.combine,
314 )
315
316 if (shouldSkipCombine || previousResult !== newResult) {
317 notifyManager.batch(() => {
318 this.listeners.forEach((listener) => {
319 listener(this.#result)
320 })
321 })
322 }
323 }
324 }
325}
326
327type QueryObserverMatch = {

Callers 2

setQueriesMethod · 0.95
#onUpdateMethod · 0.95

Calls 5

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

Tested by

no test coverage detected