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

Method clear

packages/query-core/src/queryCache.ts:254–260  ·  view source on GitHub ↗

* Removes all queries from the cache. * @example * ```ts * const queryCache = queryClient.getQueryCache() * * queryCache.clear() * ```

()

Source from the content-addressed store, hash-verified

252 * ```
253 */
254 clear(): void {
255 notifyManager.batch(() => {
256 this.getAll().forEach((query) => {
257 this.remove(query)
258 })
259 })
260 }
261
262 /**
263 * Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none

Calls 2

getAllMethod · 0.95
removeMethod · 0.95

Tested by 3

disconnectMethod · 0.36
PageFunction · 0.36
PageFunction · 0.36