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

Method destroy

packages/query-core/src/queryObserver.ts:166–171  ·  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

164 * query it was observing.
165 */
166 destroy(): void {
167 this.listeners = new Set()
168 this.#clearStaleTimeout()
169 this.#clearRefetchInterval()
170 this.#currentQuery.removeObserver(this)
171 }
172
173 /**
174 * 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