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

Method isMutating

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

* Returns the number of mutations in the cache that are currently pending, optionally * matching a set of filters. * @param filters - Narrows down which pending mutations are counted. Without filters, every * pending mutation is counted. * @returns The number of matching mutations whose

(filters?: NoInfer<Omit<TMutationFilters, 'status'>>)

Source from the content-addressed store, hash-verified

170 * ```
171 */
172 isMutating<
173 TMutationFilters extends MutationFilters<any, any> = MutationFilters<
174 any,
175 any
176 >,
177 >(filters?: NoInfer<Omit<TMutationFilters, 'status'>>): number {
178 return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length
179 }
180
181 /**
182 * Imperative (non-reactive) way to retrieve data for a QueryKey.

Callers 2

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected