MCPcopy Index your code
hub / github.com/TanStack/query / cancelQueries

Method cancelQueries

packages/query-core/src/queryClient.ts:278–291  ·  view source on GitHub ↗
(
    filters?: QueryFilters<TTaggedQueryKey>,
    cancelOptions: CancelOptions = {},
  )

Source from the content-addressed store, hash-verified

276 }
277
278 cancelQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
279 filters?: QueryFilters<TTaggedQueryKey>,
280 cancelOptions: CancelOptions = {},
281 ): Promise<void> {
282 const defaultedCancelOptions = { revert: true, ...cancelOptions }
283
284 const promises = notifyManager.batch(() =>
285 this.#queryCache
286 .findAll(filters)
287 .map((query) => query.cancel(defaultedCancelOptions)),
288 )
289
290 return Promise.all(promises).then(noop).catch(noop)
291 }
292
293 invalidateQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
294 filters?: InvalidateQueryFilters<TTaggedQueryKey>,

Callers 15

WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
ExampleWithUnknownKeyFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 2

cancelMethod · 0.80
findAllMethod · 0.45

Tested by

no test coverage detected