mbus
Version:
If Node's EventEmitter and Eve were to have a child, it might look something like this
15 lines (11 loc) • 312 B
JavaScript
var bus = require('..')();
var stopFeed = bus.feed(function(evt) {
console.log('received event name: ' + evt.name + ', with args: ', evt.args);
});
// trigger some events
bus('foo', 'hello', 'there');
bus('bar');
// terminate the feed
stopFeed();
// won't be logged as the feed has been stopped
bus('baz');