Skip to content

Instantly share code, notes, and snippets.

@nem035
Created October 6, 2018 06:59
Show Gist options
  • Select an option

  • Save nem035/4774ffd9f94a115703e7e691ca58a0b6 to your computer and use it in GitHub Desktop.

Select an option

Save nem035/4774ffd9f94a115703e7e691ca58a0b6 to your computer and use it in GitHub Desktop.
// promise chains allow us to write clean vertical code
// that is much more readable
// (no need for any reject calls either because promises
// propagate errors by default)
function getThing(arg) {
return getStuff(arg)
.then(getMoreStuff)
.then(getThatFinalThing);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment