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

Method isMutating

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

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

Callers 2

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected