|
|
|
|
|
by gorgoiler
98 days ago
|
|
I’ve been adding global listeners for click and keydown that call handleFoo(event) if event.target has a data-foo attribute. The Invoker API seems like a neater way of handling the same pattern but I’m biased towards global event listeners because they work automatically on newly injected markup and they scale O(functionality) as opposed to per element listeners that scale O(elements). I’ll be the first to admit that the latter is more of an aesthetic choice rather than being based on any kind of performance statistics. |
|