-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
perf(component): reset state / trigger CD only if necessary #3328
perf(component): reset state / trigger CD only if necessary #3328
Conversation
✅ Deploy Preview for ngrx-io ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
a890669
to
c5a9de9
Compare
7736688
to
0a26a99
Compare
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 on code, but if this changes the current behavior of two detection cycles to one, might be an unintentional breaking change for current users.
Sure, let's postpone this change for v14. I also have in mind a few more improvements, such as better typing for |
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.
Nice work!
f118acc
to
2c71c61
Compare
648713b
to
5ae9f31
Compare
ngOnInit(): void { | ||
this.subscription.add( | ||
this.renderEventManager.handlePotentialObservableChanges().subscribe() |
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.
After playing around with the suspense template, I realized that the potential observable subscription has to be moved to the ngOnInit
method in order to get initial input values on directive initialization.
5ae9f31
to
b503952
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
changeDetectorRef.detectChanges
is called in zoneless environment (reported in Push pipe calls detectChanges before setting value #3327).Closes #3327
What is the new behavior?
For both scenarios 👆 the change detection will be triggered once. The behavior for observables that emit asynchronously will remain the same..
Does this PR introduce a breaking change?