MCPcopy
hub / github.com/TanStack/query / useIsMutating

Function useIsMutating

packages/react-query/src/useMutationState.ts:14–23  ·  view source on GitHub ↗
(
  filters?: MutationFilters,
  queryClient?: QueryClient,
)

Source from the content-addressed store, hash-verified

12} from '@tanstack/query-core'
13
14export function useIsMutating(
15 filters?: MutationFilters,
16 queryClient?: QueryClient,
17): number {
18 const client = useQueryClient(queryClient)
19 return useMutationState(
20 { filters: { ...filters, status: 'pending' } },
21 client,
22 ).length
23}
24
25type MutationStateOptions<TResult = MutationState> = {
26 filters?: MutationFilters

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…