-
-
Save HendrikRoth/6a07fdd20ffcdd0e2d91 to your computer and use it in GitHub Desktop.
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
var slice = Array.prototype.slice; | |
function multi(){ | |
var handlers = slice.call( arguments ); | |
return function execute(){ | |
var args = slice.call( arguments ); | |
var ctxt = this; | |
handlers.map( function applyCtxt( fn ){ | |
if( fn instanceof Function ) fn.apply( ctxt, args ); | |
} ); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment