Created
May 3, 2011 17:28
-
-
Save ericf/953774 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function eventWrap (event, config) { | |
| var proto = this.prototype; | |
| proto[event] = function(){ | |
| if (isString(config)) { config = isFunction(this[config]) ? this[config] : null; } | |
| if (isFunction(config)) { config = { defaultFn: config }; } | |
| this.publish(event, config); | |
| function fireEvent () { | |
| this.fire(event, { args: Y.Array(arguments) }); | |
| return this; | |
| } | |
| proto[event] = fireEvent; | |
| return fireEvent.apply(this, arguments); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment