Skip to content

Instantly share code, notes, and snippets.

@ryedin
Created November 9, 2010 00:27
Show Gist options
  • Save ryedin/668526 to your computer and use it in GitHub Desktop.
Save ryedin/668526 to your computer and use it in GitHub Desktop.
quick method to wire bubbled (relayed) events
//pseudocode!!
process.EventEmitter.prototype.bubble = function(target, eventName) {
this.on(eventName, function() {
arguments.unshift(eventName);
target.emit.call(target, arguments);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment