Skip to content

Instantly share code, notes, and snippets.

@ncrohn
Created April 18, 2012 00:35
Show Gist options
  • Save ncrohn/2410119 to your computer and use it in GitHub Desktop.
Save ncrohn/2410119 to your computer and use it in GitHub Desktop.
function reroute(func, context) {
return function() {
var args = arguments;
args.push(this);
func.apply(context, args);
};
}
socket.on('windowCreated', reroute(this.windowCreated, this));
socket.on('windowDestroyed', reroute(this.windowDestroyed, this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment