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

Method destroy

packages/query-core/src/queryObserver.ts:161–166  ·  view source on GitHub ↗

* Stops observing the current query: clears all listeners, cancels the * stale and refetch-interval timers, and removes this observer from the * query it was observing.

()

Source from the content-addressed store, hash-verified

159 * query it was observing.
160 */
161 destroy(): void {
162 this.listeners = new Set()
163 this.#clearStaleTimeout()
164 this.#clearRefetchInterval()
165 this.#currentQuery.removeObserver(this)
166 }
167
168 /**
169 * Updates the observer's options. This will re-resolve the query being

Callers 1

onUnsubscribeMethod · 0.95

Calls 3

#clearStaleTimeoutMethod · 0.95
#clearRefetchIntervalMethod · 0.95
removeObserverMethod · 0.45

Tested by

no test coverage detected