Last active
July 17, 2017 12:24
-
-
Save johnstew/9fea1d2f1e6dce75bcae303597ef501d 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
function fakeAsyncCall(resultText = 'foo data') { | |
return new Promise((resolve) => { | |
setTimeout(() => resolve(resultText), 1000); | |
}); | |
} | |
function getData() { | |
fakeAsyncCall() | |
.then(fakeAsyncCall) | |
.then(fakeAsyncCall) | |
.then(fakeAsyncCall) | |
.catch(console.error) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment