Skip to content

Instantly share code, notes, and snippets.

@darrellpratt
Created May 25, 2016 17:08
Show Gist options
  • Save darrellpratt/b37f494104a64690b147e7aff8e59b24 to your computer and use it in GitHub Desktop.
Save darrellpratt/b37f494104a64690b147e7aff8e59b24 to your computer and use it in GitHub Desktop.
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