Last active
March 8, 2018 17:06
-
-
Save adambene/bcbe27f66cc5f7874aba2d2c4f357cc6 to your computer and use it in GitHub Desktop.
Delays With Promise Chaining in JavaScript
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 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