Library that emits custom events.
Ideally a class should inherits it Api
[ on, off, emit ]
instead of using it directly.
Just instantiate the eventEmitter class.
var eventEmitter = new EventEmitter();
Then bind some events.
eventEmitter.on('start', function(e) {
console.log('Start event emitted:', e);
});
And dispatch them when you need them.
eventEmitter.emit('start', 'This is a string...');
Emit can send as many arguments and variable types as you want.
To delete events just execute off
.
eventEmitter.off('start');