Created
June 4, 2015 14:44
-
-
Save hughfdjackson/fa55768e585b5f704462 to your computer and use it in GitHub Desktop.
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
var composeBack = function(nb2, nb1){ | |
return function(input, cb){ | |
nb1(input, function(err, val1) { | |
if (err) return cb(err); | |
else nb2(val1, function(err, val){ | |
if (err) return cb(err); | |
else cb(undefined, val) | |
}) | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment