Skip to content

Instantly share code, notes, and snippets.

@phil-kahrl
Created August 16, 2018 20:02
Show Gist options
  • Save phil-kahrl/3a843b941098ca5a1d3bfddce1daa0f6 to your computer and use it in GitHub Desktop.
Save phil-kahrl/3a843b941098ca5a1d3bfddce1daa0f6 to your computer and use it in GitHub Desktop.
Example Promise Chain
/*
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