MCPcopy Create free account
hub / github.com/TanStack/query / onSubscribe

Method onSubscribe

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

Source from the content-addressed store, hash-verified

84 }
85
86 protected onSubscribe(): void {
87 if (this.listeners.size === 1) {
88 this.#observers.forEach((observer) => {
89 observer.subscribe((result) => {
90 this.#onUpdate(observer, result)
91 })
92 })
93 }
94 }
95
96 protected onUnsubscribe(): void {
97 if (!this.listeners.size) {

Callers

nothing calls this directly

Calls 2

#onUpdateMethod · 0.95
subscribeMethod · 0.45

Tested by

no test coverage detected