* Permanently disconnects the controller and removes it from its host, if * the host supports `removeController`. The controller ignores later * lifecycle callbacks.
()
| 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. |
nothing calls this directly
no test coverage detected