Skip to content

Instantly share code, notes, and snippets.

@Enome
Created March 19, 2013 19:27
Show Gist options
  • Save Enome/5199328 to your computer and use it in GitHub Desktop.
Save Enome/5199328 to your computer and use it in GitHub Desktop.
var service = function () {
var ee = new EventEmitter();
process.nextTick(function () {
ee.emit('error', 'some error');
ee.emit('service', 'some serice');
});
return {
error: function (callback) {
ee.on('error', callback)
},
service: function (callback) {
ee.on('service', callback)
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment