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

Method #notify

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

Source from the content-addressed store, hash-verified

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

Callers 2

setQueriesMethod · 0.95
#onUpdateMethod · 0.95

Calls 5

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

Tested by

no test coverage detected