Last active
November 5, 2015 18:26
-
-
Save tario/7827b9dbdd27fac58fdf to your computer and use it in GitHub Desktop.
PromiseCode
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
return Q.Promise(function(resolve, reject) { | |
return request.post(options, function(err, response, body){ | |
if (err){ reject(err) } | |
resolve(body); | |
}); | |
}); | |
return Q.nfcall(function(options, cb) { | |
return request.post(options, function(err, response, body) { | |
cb(err, body); | |
}); | |
}, options); | |
var requestPost = Q.denodeify(function(options, cb) { | |
return request.post(function(err, response, body) { | |
cb(err, body); | |
}); | |
}); | |
return requestPost(options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment