package
Node's EventEmitter mixin
npm install emitter-mixinGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Node EventEmitter mixin.
var emitter = require('emitter-mixin');
function Person () {}
emitter(Person.prototype);
var person = new Person();
person.on('foo', function (arg) {
console.log(arg);
}).emit('foo', 'bar');
// > barYou don't have to do Emitter.call(this) in your constructor
anymore, the mixin defines an _events getter that does the
magic for you.
emitter(Person.prototype);
var person = new Person();
person._events == person._events;
// > true
person._events == Person.prototype._events;
// > false$ make test(MIT)