4 ms·
The problem I had with getters in a fairly complex application (WYSIWYG editor) was handling mouse events, in particular onMouseMove - change detection was trig
by ptrwis 3y ago
The problem I had with getters in a fairly complex application (WYSIWYG editor) was handling mouse events, in particular onMouseMove - change detection was triggered on every such event, and the application was very slow.
EDIT: It was slow because there were many getters based on other getters etc and everything was recalculated on each event.
- spyke112 3y agoI don’t think a computed property would behave any better. It sounds like your event handling should have been decoupled from change detection and only applied changes when necessary. This would probably be a problem in any framework.
- ptrwis 3y agoThis is an issue with zone.js + getters, I changed the key components to OnPush change detection.