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

Method isMutating

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

* Returns the number of mutations in the cache that are currently pending, optionally * matching a set of filters. * * @example * ```ts * if (queryClient.isMutating()) { * console.log('At least one mutation is pending!') * } * ```

(filters?: TMutationFilters)

Source from the content-addressed store, hash-verified

166 * ```
167 */
168 isMutating<
169 TMutationFilters extends MutationFilters<any, any> = MutationFilters,
170 >(filters?: TMutationFilters): number {
171 return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length
172 }
173
174 /**
175 * Imperative (non-reactive) way to retrieve data for a QueryKey.

Callers 2

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected