Share your code.
simple streaming DOM event delegation
var events =var values =
events(element, eventName[, selector, options]) -> ReadableStream
- if selector is provided, delegation will be used, otherwise it will not.
- valid options are:
preventDefault <boolean>: will call
preventDefault()on all matched events. Defaults to
stopPropagation <boolean>: will call
stopPropagation()on all matched events. Defaults to
useCapture <boolean>: will initiate capture for matched events. Defaults to
- when using delegation, the element that matches your selector will be
.end()or otherwise ending the stream returned by
dom-delegation-streamwill remove the listeners added for event handling.
- there are some alternative options for event handling on npm, a couple that even support delegation, and even some that are streaming. this module was created as an effort to provide a better balance of simplicity and flexibility.