Closed simply10w closed 5 years ago
Great catch! I would say go for it 😄
Great. I'll play around! 😄
Also, if I remember correctly it should be possible to adjust configuration in angular.json
so that all components generated using ng g c
are automatically OnPush
by default which would make sense in this case ;)
You are right, there is. They have changed a little the way how it's done, now we need to point to the schematic for components, but that ability is still there.
I'll add that also.
Thanks for the tip. :D
Looking forward to it!
Describe the feature you'd like:
Adding OnPush change detection to all components.
Since we already are utilizing @ngrx/store with rxjs streams and async pipe, we get markForCheck for free in most situations.
By adding on push, only some parts of the application would need to be checked when change detection runs. Currently it runs over the entire tree.
That way we would also enforce good practices from the get go, avoiding mutating state, and if mutation needs to happen, triggering change detection manually.
Other information:
I would be willing to submit a PR to fix this issue:
[ x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No