Last active
June 23, 2016 19:17
-
-
Save colwem/b29f13a89190cbd6d98d93b493040f87 to your computer and use it in GitHub Desktop.
Promise nesting
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
Promise = require('bluebird'); | |
promiseOfA.then((a) => { | |
return usesAPromisesB(a).then((b) => { | |
return usesAAndB(a, b); | |
}); | |
}); | |
// or | |
let promiseOfB = promiseOfA.then((a) => { | |
return usesAPromisesB(a); | |
}); | |
Promise.join(promiseOfA, promiseOfB, (a, b) => usesAAndB(a, b)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment