listen-emitter
Mixin for event-emitter inversion of control listen functions
Useage
var extend = ;var Emitter = EventEmitter;var ListenToEmitter = ; // creates class using emitter and listento functions { }; // create instances (have listenTo/ListenOnce/stopListening)var tower = ;var plane = ; // tower listens for place.emit callstower // causes tower's listenTo callback to fireplane;
Methods
Methods are defined with the expectation that they will be extended into an instance or prototype of an object. They won't work as static functions.
listenTo(obj, events, callback)
Creates a listener that fires callback function when target object events are emitted.
tower
listenOnce(obj, events, callback)
Creates a listener that fires callback function once when target object events are emitted.
plane
stopListening(obj, events, callback)
Removes specified listener. If any of the arguments are undefined, listeners that match remaining arguments will be removed. If no arguments are passed, all listeners will be removed.
tower;