Decorate elements with delegated events
dom-delegator allows you to attach an
a dom element.
When event of the correct type occurs
This allows you to seperate your event listeners from your event writers. Sprinkle your event writers in the template in one part of your codebase. Attach listeners to the event sources in some other part of the code base.
This decouples the event definition in the DOM from your event listeners in your application code.
for the same idea using html
var document =var Delegator =var EventEmitter = EventEmittervar del =var emitter =emittervar elem = document// add individual elems. (in a different file?)deldel
Sometimes you don't want to add events bound to an element but instead listen to them globally.
var Delegator =var d =dd
npm install dom-delegator