-
Notifications
You must be signed in to change notification settings - Fork 27k
refactor(core): use ApplicationRef.whenStable instead of a custom util function
#58834
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
Conversation
…til function This commit removes a custom `whenStable` util in favor of standard `ApplicationRef.whenStable` API. There is also an important different between the custom `whenStable` function and `ApplicationRef.whenStable` implementation: the `whenStable` was caching the "stable" promise on per-ApplicationRef basis, which resulted in unexpected behavior with zoneless, when some code ended up getting a stale resolved promise, when an application was not stable yet, this causing order of operations issues. This commit also has an extra test that covers that case.
573c149 to
7569490
Compare
alan-agius4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@AndrewKushnir @alan-agius4 I removed the same on angular cli based on the comments angular/angular-cli#28944 |
@sheikalthaf thanks for your help! |
…til function (#58834) This commit removes a custom `whenStable` util in favor of standard `ApplicationRef.whenStable` API. There is also an important different between the custom `whenStable` function and `ApplicationRef.whenStable` implementation: the `whenStable` was caching the "stable" promise on per-ApplicationRef basis, which resulted in unexpected behavior with zoneless, when some code ended up getting a stale resolved promise, when an application was not stable yet, this causing order of operations issues. This commit also has an extra test that covers that case. PR Close #58834
|
This PR was merged into the repository by commit 7f6f5f9. The changes were merged into the following branches: main, 19.0.x |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit removes a custom
whenStableutil in favor of standardApplicationRef.whenStableAPI.There is also an important difference between the custom
whenStablefunction andApplicationRef.whenStableimplementation: thewhenStablewas caching the "stable" promise on per-ApplicationRef basis, which resulted in unexpected behavior with zoneless, when some code ended up getting a stale resolved promise, when an application was not stable yet, this causing order of operations issues. This commit also has an extra test that covers that case.Does this PR introduce a breaking change?