Created
May 30, 2017 02:54
-
-
Save bdunn313/2cf3b64b3501acf72cfc4cb53c196a19 to your computer and use it in GitHub Desktop.
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
// Fancy new function syntax | |
fakeNetworkCall('/api/endpoint/1/') | |
.then(result => fakeNetworkCall('/api/endpoint/2/')) | |
.then(result => fakeNetworkCall('/api/endpoint/3/')) | |
// Maybe we finally call a render method on our last request? | |
.then(result => renderToPage(result)) | |
// Make sure any errors are caught. | |
.catch(error => handleError(error)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment