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

Function destroy

packages/lit-query/src/controllers/BaseController.ts:128–145  ·  view source on GitHub ↗

* Permanently disconnects the controller and removes it from its host, if * the host supports `removeController`. The controller ignores later * lifecycle callbacks.

()

Source from the content-addressed store, hash-verified

126 * lifecycle callbacks.
127 */
128 destroy(): void {
129 if (this.destroyed) {
130 return
131 }
132
133 this.destroyed = true
134 this.connected = false
135 this.connectionAttempt += 1
136 this.clearContextClient()
137 this.queryClientResolutionState = this.explicitClient
138 ? 'bound'
139 : 'pre-connect'
140 this.onDisconnected()
141
142 if ('removeController' in this.host) {
143 this.host.removeController(this)
144 }
145 }
146
147 /**
148 * Returns the `QueryClient` without throwing when none is available.

Callers

nothing calls this directly

Calls 1

onDisconnectedMethod · 0.45

Tested by

no test coverage detected