Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

injectIsMutating.md

42 lines1.5 KB

1---
2id: injectIsMutating
3title: injectIsMutating
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8```ts
9function injectIsMutating(filters?: () => MutationFilters): Signal<number>;
10```
11​
12Defined in: [packages/angular-query/src/inject-is-mutating.ts:15](https://github.com/TanStack/query/blob/main/packages/angular-query/src/inject-is-mutating.ts#L15)
13​
14Injects a signal that tracks the number of mutations that your application currently has `pending`
15(useful for app-wide loading indicators).
16​
17Can be used for app-wide loading indicators.
18​
19## Parameters
20​
21### filters?
22​
23() => [`MutationFilters`](../interfaces/MutationFilters.md)
24​
25A reactive factory for the filters.
26​
27<a id="filters-properties"></a>
28​
29#### `filters` properties
30​
31| Property | Type | Description |
32| ------ | ------ | ------ |
33| <a id="filters-property-exact"></a> `exact?` | `boolean` | Match mutation key exactly |
34| <a id="filters-property-mutationkey"></a> `mutationKey?` | readonly `unknown`[] | Include mutations matching this mutation key |
35| <a id="filters-property-predicate"></a> `predicate?` | (`mutation`: [`Mutation`](../classes/Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>) => `boolean` | Include mutations matching this predicate function |
36| <a id="filters-property-status"></a> `status?` | `"error"` \| `"pending"` \| `"success"` \| `"idle"` | Filter by mutation status |
37​
38## Returns
39​
40`Signal`\<`number`\>
41​
42A read-only signal with the number of fetching mutations.