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

Method onSubscribe

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

Source from the content-addressed store, hash-verified

57 }
58
59 protected onSubscribe(): void {
60 if (this.listeners.size === 1) {
61 this.#observers.forEach((observer) => {
62 observer.subscribe((result) => {
63 this.#onUpdate(observer, result)
64 })
65 })
66 }
67 }
68
69 protected onUnsubscribe(): void {
70 if (!this.listeners.size) {

Callers

nothing calls this directly

Calls 2

#onUpdateMethod · 0.95
subscribeMethod · 0.45

Tested by

no test coverage detected