Skip to content

Instantly share code, notes, and snippets.

@adambene
Last active March 8, 2018 17:06
Show Gist options
  • Save adambene/bcbe27f66cc5f7874aba2d2c4f357cc6 to your computer and use it in GitHub Desktop.
Save adambene/bcbe27f66cc5f7874aba2d2c4f357cc6 to your computer and use it in GitHub Desktop.
Delays With Promise Chaining in JavaScript
function delays() {
return delay(800, "Hello, I'm in a").then(a => {
console.log(a);
return delay(400, "Promise!");
}).then(b => {
console.log(b);
});
}
// call it
delays();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment