event-map
A module to ease the addition and removal of a mapping of delegated listeners to a view. Inspired by Backbone.View's delegateEvents. A mapping consists of an object where the key is an event and optionally a selector as well and the value is a listener function.
Install
npm install event-map --save
Usage
eventMap([domElement,] map [, useCapture])
On a domElement, append these listeners delegated to the provided selectors:
var removeListeners = ; //at a later timer, clean up:;
If no domElement is provided, all events are placed on document:
var removeListeners = ;
License
MIT, see LICENSE.md for details.