Open History to see the last commit
1---
2id: useIsMutating
3title: useIsMutating
4redirect_from:
5 - framework/solid/reference/useIsMutating
6---
7β
8<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
9β
10```ts
11function useIsMutating(filters?: Accessor<MutationFilters<unknown, Error, unknown, unknown>>, queryClient?: Accessor<QueryClient>): Accessor<number>;
12```
13β
14Defined in: [packages/solid-query/src/useIsMutating.ts:26](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useIsMutating.ts#L26)
15β
16The `useIsMutating` primitive returns the `number` of mutations that your application currently has `pending`
17(useful for app-wide loading indicators).
18β
19## Parameters
20β
21### filters?
22β
23`Accessor`\<[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\>\>
24β
25An accessor returning the [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations.
26β
27<a id="filters-properties"></a>
28β
29#### `filters` properties
30β
31Built from [`MutationFilters`](../interfaces/MutationFilters.md#properties). See the type above for what it changes.
32β
33### queryClient?
34β
35`Accessor`\<[`QueryClient`](../classes/QueryClient.md)\>
36β
37An accessor for a custom `QueryClient`. Otherwise, the one from the nearest context
38will be used.
39β
40## Returns
41β
42`Accessor`\<`number`\>
43β
44An accessor for the `number` of the mutations that your application currently has `pending`.
45β
46## Example
47β
48```tsx
49import { useIsMutating } from '@tanstack/solid-query'
50β
51function PostsMutatingIndicator() {
52 // How many mutations matching the posts prefix are in progress?
53 const isMutatingPosts = useIsMutating(() => ({ mutationKey: ['posts'] }))
54β
55 return isMutatingPosts() > 0 ? <span>Saving posts...</span> : null
56}
57```