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

Method #onUpdate

packages/query-core/src/queriesObserver.ts:383–390  ·  view source on GitHub ↗
(observer: QueryObserver, result: QueryObserverResult)

Source from the content-addressed store, hash-verified

381 }
382
383 #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {
384 const index = this.#observers.indexOf(observer)
385 if (index !== -1) {
386 this.#result = this.#result.slice()
387 this.#result[index] = result
388 this.#notify()
389 }
390 }
391
392 #notify(): void {
393 if (this.hasListeners()) {

Callers 2

onSubscribeMethod · 0.95
setQueriesMethod · 0.95

Calls 1

#notifyMethod · 0.95

Tested by

no test coverage detected