Better event listeners

We discussed this a long time ago. Lets try again. I think ideally we
introduce something like http://api.jquery.com/on/ Lets not focus on
the API for now, but on what we want to accomplish.

Type and callback are the basics. Selector-based filtering of
event.currentTarget should be there, but optional. I'm not sure about
the data feature, Yehuda?

Should we make all events bubble for the purposes of this new
registration mechanism? I actually thought Jonas said jQuery did that
at some point, but the jQuery documentation does not suggest it does.

Should we have event-data-based filtering? E.g. developers could
register to only get key events for the WASD keys. Optimization for
developers could be that they get to have one callback per key,
optimization for browsers and speed of the application would be that
less events need to be processed ideally leading to a better user
experience.

It seems capture-listeners are not needed. At least for now.


-- 
http://annevankesteren.nl/

Received on Saturday, 5 January 2013 12:27:20 UTC