Created
May 25, 2016 17:08
-
-
Save darrellpratt/b37f494104a64690b147e7aff8e59b24 to your computer and use it in GitHub Desktop.
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
step1(function (value1) { | |
step2(value1, function(value2) { | |
step3(value2, function(value3) { | |
step4(value3, function(value4) { | |
// Do something with value4 | |
}); | |
}); | |
}); | |
}); | |
Q.fcall(promisedStep1) | |
.then(promisedStep2) | |
.then(promisedStep3) | |
.then(promisedStep4) | |
.then(function (value4) { | |
// Do something with value4 | |
}) | |
.catch(function (error) { | |
// Handle any error from all above steps | |
}) | |
.done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment