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

Method #notify

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

Source from the content-addressed store, hash-verified

308 }
309
310 #notify(): void {
311 if (this.hasListeners()) {
312 const shouldSkipCombine = this.#shouldSkipCombine()
313 const previousResult = this.#combinedResult
314 const newResult = shouldSkipCombine
315 ? previousResult
316 : this.#combineResult(
317 this.#trackResult(this.#result, this.#observerMatches),
318 this.#options?.combine,
319 )
320
321 if (shouldSkipCombine || previousResult !== newResult) {
322 notifyManager.batch(() => {
323 this.listeners.forEach((listener) => {
324 listener(this.#result)
325 })
326 })
327 }
328 }
329 }
330}
331
332type 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