Site too slow, please start using event delegation

Each page on the site has 200-500+ event listeners in Javascript despite many of them doing exactly the same thing. Looking at the pages in Web Inspector I can see they’ve got individual listeners as they’re created (the way we did things 20 years ago when pages were smaller) instead of delegating to a container element (which automatically applies to any new elements as the page scrolls).

There are some articles on doing this in React, where the event handler is attached to the container element (usually a `div

Please authenticate to join the conversation.

Upvoters
Status

Awaiting Dev Review

Board

πŸ’‘ Feature Request

Date

10 months ago

Author

ydoomenaud

Subscribe to post

Get notified by email when there are changes.