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

injectIsFetching.md

44 lines1.7 KB

1---
2id: injectIsFetching
3title: injectIsFetching
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8```ts
9function injectIsFetching(filters?: () => QueryFilters): Signal<number>;
10```
11​
12Defined in: [packages/angular-query/src/inject-is-fetching.ts:15](https://github.com/TanStack/query/blob/main/packages/angular-query/src/inject-is-fetching.ts#L15)
13​
14Injects a signal that tracks the number of queries that your application is loading or fetching in the
15background (useful for app-wide loading indicators).
16​
17Can be used for app-wide loading indicators.
18​
19## Parameters
20​
21### filters?
22​
23() => [`QueryFilters`](../interfaces/QueryFilters.md)
24​
25A reactive factory for the filters.
26​
27<a id="filters-properties"></a>
28​
29#### `filters` properties
30​
31| Property | Type | Default value | Description |
32| ------ | ------ | ------ | ------ |
33| <a id="filters-property-exact"></a> `exact?` | `boolean` | `undefined` | Match query key exactly |
34| <a id="filters-property-fetchstatus"></a> `fetchStatus?` | `"fetching"` \| `"paused"` \| `"idle"` | `undefined` | Include queries matching their fetchStatus |
35| <a id="filters-property-predicate"></a> `predicate?` | (`query`: [`Query`](../classes/Query.md)) => `boolean` | `undefined` | Include queries matching this predicate function |
36| <a id="filters-property-querykey"></a> `queryKey?` | `TQueryKey` \| `TuplePrefixes`\<`TQueryKey`\> | `undefined` | Include queries matching this query key |
37| <a id="filters-property-stale"></a> `stale?` | `boolean` | `undefined` | Include or exclude stale queries |
38| <a id="filters-property-type"></a> `type?` | `QueryTypeFilter` | `'all'` | Filter to active queries, inactive queries or all queries |
39​
40## Returns
41​
42`Signal`\<`number`\>
43​
44signal with number of loading or fetching queries.