Created
November 9, 2010 16:11
-
-
Save leetreveil/669300 to your computer and use it in GitHub Desktop.
Takes an internal event and re-emits it as the parent and with an alias.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processor.emit = function() { | |
var event = arguments[0]; | |
var value = arguments[1]; | |
//emit original event | |
self.emit(event, value); | |
//rewrite to new alias | |
for(var i in MAPPINGS){ | |
var current = MAPPINGS[i]; | |
if(current.from.indexOf(event) > -1){ | |
self.emit(current.to, value); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment