eventemitter with generator support (through co). eventemitter-co mimics require('events').EventEmitter
API.
var sleep = require('nyks/function/sleep');
var Event = require('eventemitter-co');
var event = new Event();
var cafe = {color:'black'};
event.on("start", function*() {
yield sleep(1);
console.log("Hi, coffee is ", this.color);
}, cafe);
event.emit("start");
event.emit() will return a promise you can work with if you need to handle errors
You can set an optional 3rd parameter and set the context ("this") in event registration.
events, eventemitter2, co, generators, promise, binding