Skip to content

Instantly share code, notes, and snippets.

@ivaneroshkin
Last active March 14, 2020 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivaneroshkin/235585f595d48ea09f3c150b8bf10dce to your computer and use it in GitHub Desktop.
Save ivaneroshkin/235585f595d48ea09f3c150b8bf10dce to your computer and use it in GitHub Desktop.
function wait(ms = 0) {
return new Promise(resolve => setTimeout(resolve, ms));
}
wait(200)
.then(() => {
console.log('Appeared after 200ms');
return wait(500);
})
.then(() => {
console.log('Appeared after 500ms');
return wait(1000);
})
.then(() => {
console.log('Appeared after 1s');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment