Created
August 14, 2017 22:46
-
-
Save brianswisher/60bbb00b79815913934166dfb4d7bee9 to your computer and use it in GitHub Desktop.
Wait w/ a promise
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
function wait (delay = 1000) { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve() | |
}, delay) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment