demo · v135

Event delegation bench

Compare event delegation with command events against the classic click-listener pattern. Each side has 16 buttons firing on a parent container. The delegated command handler reads event.command + event.source with no per-button wiring; the classic side needs an inline data-attribute and closest() climb.

command event: ?

delegated — command event

click any button
0 eventslast: —

classic — click listener

click any button
0 eventslast: —

see also