Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dtipson
Created August 14, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtipson/90e5309da54f95d22105 to your computer and use it in GitHub Desktop.
Save dtipson/90e5309da54f95d22105 to your computer and use it in GitHub Desktop.
A program with a method that allows you to bake in a catch
program2 = function(/*...list of functions*/){
var context = this,
args = arguments,
chain = pipe2.call(this,arguments);
chain.catch = function(catchfn){
return function(unit){
return program2.apply(context,args)(unit).catch(catchfn);
};
};
return chain;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment