Created
August 23, 2016 21:34
-
-
Save pgarciacamou/6ce8d11ac00221beb2304a053bdd6404 to your computer and use it in GitHub Desktop.
Callback executer wrapper.
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 execute(){ | |
var callbacks = Array.prototype.map.call(arguments, function(callback){ | |
return callback instanceof Function && callback; | |
}); | |
return function(){ | |
var self = this; | |
var args = arguments; | |
callbacks.forEach(function (callback){ | |
callback.apply(self, args); | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is sort of like lodash _.flow but it doesn't pass the response to the next callback.