var eventEmitter = new hx.EventEmitter;
eventEmitter.on('my-event', function(d){ console.log(d) });
// this will result in the object {x: 0, y: 123} being logged to the console
eventEmitter.emit('my-event', {
x: 0,
y: 123
});
var ee1 = new hx.EventEmitter;
var ee2 = new hx.EventEmitter;
// pipe events from ee1 into ee2 with prefix `my-prefix`
ee1.pipe(ee2, 'my-prefix');
// listen for events from ee1 being piped through
ee2.on('my-prefix.click', function(){
console.log('got here');
});
// will cause 'got here' to be logged
ee1.emit('click');