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

Method unmount

packages/query-core/src/queryClient.ts:126–135  ·  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

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

Callers 15

mountFunction · 0.45
unmountFunction · 0.45
PreactQueryDevtoolsFunction · 0.45
PreactQueryDevtoolsPanelFunction · 0.45
unmountClientMethod · 0.45
cleanupFunction · 0.45
QueryClientProviderFunction · 0.45
ReactHydrateFunction · 0.45
useQuery.test.tsxFile · 0.45
QueryClientProviderFunction · 0.45
useQuery.test.tsxFile · 0.45

Calls

no outgoing calls

Tested by 1

ReactHydrateFunction · 0.36