Created
August 16, 2018 20:02
-
-
Save phil-kahrl/3a843b941098ca5a1d3bfddce1daa0f6 to your computer and use it in GitHub Desktop.
Example Promise Chain
This file contains hidden or 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
/* | |
Example of a Promise chain. | |
As each Promise is resolved, the resolved value is passed | |
to the next Promise in the chain. | |
*/ | |
a().then( (resultFromA) => { | |
b(resultFromA).then( (resultFromB) => { | |
c(resultFromB).then( (resultFromC) => { | |
d( (resultFromC).then( | |
//And so on and so forth. | |
}) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment