Skip to content

fix(angular-query): ensure initial mutation pending state is emitted #9098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThiloAschebrock
Copy link

Fixes #9020

The issue was that the effect that subscribes to the observer runs after the observer emits the first state change if the mutation is triggered in the constructor of a component or ngOnInit. This is fixed by immediately subscribing when the initial result is computed.

One could also consider combining resultFromSubscriberSignal and resultFromInitialOptionsSignal into a single linkedSignal, but this would require dropping support for Angular 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular: injectMutation skips pending state when triggered in constructor or ngOnInit
1 participant