2 ms·
I did not see mention of event delegation in the article. Registering thousands of event handlers on one screen can have performance impact, and is generally w
by donoftime 3y ago
I did not see mention of event delegation in the article.
Registering thousands of event handlers on one screen can have performance impact, and is generally why registering them on individual elements becomes a problem for an interactive page. Registering on a parent element can provide the same interactivity with only a single handler thanks to event bubbling.
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_delegation https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Bu...
- alexpetros 3y agoThis is a good point. I think it's sort of an implementation detail, but it also implicates how you might design the interface (i.e. with inheritance or not). In any case, thanks for the link.