Created
September 10, 2012 04:28
-
-
Save cjpartridgeb/3688880 to your computer and use it in GitHub Desktop.
Simple curry example
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
// assuming http.get fires back err, result | |
function curryGet = function(url) { | |
return function(callback) { | |
http.get(url, callback); | |
} | |
} | |
async.parallel([ | |
curryGet('www.google.com'), | |
curryGet('www.nodejs.org'), | |
], | |
function(err, results){}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment