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

Function useIsMutating

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

Source from the content-addressed store, hash-verified

33 * ```
34 */
35export function useIsMutating(
36 filters?: MutationFilters,
37 queryClient?: QueryClient,
38): number {
39 const client = useQueryClient(queryClient)
40 return useMutationState(
41 { filters: { ...filters, status: 'pending' } },
42 client,
43 ).length
44}
45
46type MutationTypeFromResult<TResult> = [TResult] extends [
47 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