Created
January 19, 2017 22:16
-
-
Save ericelliott/2a1fa460e3e8330c5a2cad87acccb015 to your computer and use it in GitHub Desktop.
Wait -- an ES6 promise example
This file contains 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
const wait = time => new Promise((resolve) => setTimeout(resolve, time)); | |
wait(3000).then(() => console.log('Hello!')); // 'Hello!' |
vixeven
commented
Aug 11, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment