Skip to content

Instantly share code, notes, and snippets.

@johnstew
Last active July 17, 2017 12:24
Show Gist options
  • Save johnstew/9fea1d2f1e6dce75bcae303597ef501d to your computer and use it in GitHub Desktop.
Save johnstew/9fea1d2f1e6dce75bcae303597ef501d to your computer and use it in GitHub Desktop.
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