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

Method unmount

packages/query-core/src/queryClient.ts:127–136  ·  view source on GitHub ↗

* The inverse of QueryClient#mount — called by a framework adapter's * `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online * listeners once the mount count returns to `0`.

()

Source from the content-addressed store, hash-verified

125 * listeners once the mount count returns to `0`.
126 */
127 unmount(): void {
128 this.#mountCount--
129 if (this.#mountCount !== 0) return
130
131 this.#unsubscribeFocus?.()
132 this.#unsubscribeFocus = undefined
133
134 this.#unsubscribeOnline?.()
135 this.#unsubscribeOnline = undefined
136 }
137
138 /**
139 * Returns the number of queries in the cache that are currently fetching, optionally

Callers 15

PreactQueryDevtoolsFunction · 0.45
PreactQueryDevtoolsPanelFunction · 0.45
unmountClientMethod · 0.45
cleanupFunction · 0.45
QueryClientProviderFunction · 0.45
ReactHydrateFunction · 0.45
useQuery.test.tsxFile · 0.45
provideQueryClientFunction · 0.45
destroyFunction · 0.45
destroyDevtoolsFunction · 0.45
QueryClientProviderFunction · 0.45

Calls

no outgoing calls

Tested by 1

ReactHydrateFunction · 0.36