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

Method #subscribeTo

packages/query-core/src/queriesObserver.ts:392–398  ·  view source on GitHub ↗
(observer: QueryObserver)

Source from the content-addressed store, hash-verified

390 }
391
392 #subscribeTo(observer: QueryObserver): void {
393 // Create the listener here, not in `setQueries`: a listener created there
394 // keeps the previous observers, and their queries, alive (#12656)
395 observer.subscribe((result) => {
396 this.#onUpdate(observer, result)
397 })
398 }
399
400 #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {
401 const index = this.#observers.indexOf(observer)

Callers 2

onSubscribeMethod · 0.95
setQueriesMethod · 0.95

Calls 2

#onUpdateMethod · 0.95
subscribeMethod · 0.45

Tested by

no test coverage detected