Re:Angular v16
by ptrwis on Thursday May 04, 2023 @06:02AM
(#35813201)
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.
[ Parent
| on HN ]
I 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.