function injectIsMutating(filters?, options?): Signal<number>;Defined in: inject-is-mutating.ts:46
Injects a signal that tracks the number of mutations that your application currently has pending (useful for app-wide loading indicators).
MutationFilters<unknown, Error, unknown, unknown>
The MutationFilters to narrow down the matched mutations.
Additional configuration
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'] })
}