Created
October 6, 2018 06:59
-
-
Save nem035/4774ffd9f94a115703e7e691ca58a0b6 to your computer and use it in GitHub Desktop.
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
| // 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