scoped-event-emitter
v1.0.0
Published
EventEmitter with configurable listener scope
Downloads
3
Readme
ScopedEventEmitter
Extension to the standard EventEmitter which accepts a scope object during construction. This object will be set as the scope for all event listeners.
Using ScopedEventEmitter
var ScopedEventEmitter = require("scoped-event-emitter"),
obj = {},
emitter = new ScopedEventEmitter(obj);
emitter.on("foo", function() {
assert(this === obj);
});