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

Function useIsMutating

packages/react-query/src/useMutationState.ts:32–41  ·  view source on GitHub ↗
(
  filters?: Omit<MutationFilters, 'status'>,
  queryClient?: QueryClient,
)

Source from the content-addressed store, hash-verified

30 * ```
31 */
32export function useIsMutating(
33 filters?: Omit<MutationFilters, 'status'>,
34 queryClient?: QueryClient,
35): number {
36 const client = useQueryClient(queryClient)
37 return useMutationState(
38 { filters: { ...filters, status: 'pending' } },
39 client,
40 ).length
41}
42
43type MutationTypeFromResult<TResult> = [TResult] extends [
44 MutationState<

Callers 10

WithKnownParametersFunction · 0.90
WithIdentifiersFunction · 0.90
WithKnownParametersFunction · 0.90
WithIdentifiersFunction · 0.90
ExamplesFunction · 0.90
ExamplesFunction · 0.90
IsMutatingFunction · 0.50
PageFunction · 0.50
IsMutatingFunction · 0.50

Calls 2

useQueryClientFunction · 0.90
useMutationStateFunction · 0.70

Tested by 3

IsMutatingFunction · 0.40
PageFunction · 0.40
IsMutatingFunction · 0.40