Skip to content

Instantly share code, notes, and snippets.

@pgarciacamou
Created August 23, 2016 21:34
Show Gist options
  • Save pgarciacamou/6ce8d11ac00221beb2304a053bdd6404 to your computer and use it in GitHub Desktop.
Save pgarciacamou/6ce8d11ac00221beb2304a053bdd6404 to your computer and use it in GitHub Desktop.
Callback executer wrapper.
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);
});
};
}
@pgarciacamou
Copy link
Author

This is sort of like lodash _.flow but it doesn't pass the response to the next callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment