Created
August 14, 2015 16:19
-
-
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
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
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