function injectIsMutating(filters?: () => Omit<MutationFilters, "status">): Signal<number>;Defined in: packages/angular-query/src/inject-is-mutating.ts:30
Injects a signal that tracks the number of mutations that your application currently has pending (useful for app-wide loading indicators).
() => Omit<MutationFilters, "status">
A function returning the MutationFilters to narrow down the matched mutations. Similar to computed from Angular, this function runs in the reactive context, so signals read inside it re-narrow the matched mutations.
Built from MutationFilters. See the type above for what it changes.
Signal<number>
A Signal with the number of mutations that your application currently has pending.
@Component({
selector: 'posts-mutating-indicator',
template: `
@if (isMutatingPosts()) {
<span>Saving posts...</span>
}
`,
})
export class PostsMutatingIndicator {
// How many mutations matching the posts prefix are in progress?
readonly isMutatingPosts = injectIsMutating(() => ({ mutationKey: ['posts'] }))
}