Skip to content

Instantly share code, notes, and snippets.

@johnstew
Last active July 17, 2017 12:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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