add event delegation to ever event emitters
DOM event delegation, a la jQuery's
el.on('click', 'selector > selector') method.
var ever = require'ever'sel = require'cssauron-html'delegate = require'ever-delegate'delegateeverdocumentbody sel'a[href^=/]'on'click'console.logthis // <-- the <a> element selected by the above
Create a delegate event emitter. Works with any event emitter that emits DOM event objects.
filterFunction is a function that takes one argument -- a node --
and returns whether or not that node should be considered a match or
not. This is compatible with the
matchesSelector spec (available as
mozMatchesSelector). It's also compatible with CSSauron selectors.