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

Method onSubscribe

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

Source from the content-addressed store, hash-verified

92 }
93
94 protected override onSubscribe(): void {
95 if (this.listeners.size === 1) {
96 this.#observers.forEach((observer) => {
97 observer.subscribe((result) => {
98 this.#onUpdate(observer, result)
99 })
100 })
101 }
102 }
103
104 protected override onUnsubscribe(): void {
105 if (!this.listeners.size) {

Callers

nothing calls this directly

Calls 2

#onUpdateMethod · 0.95
subscribeMethod · 0.45

Tested by

no test coverage detected