Created
January 31, 2018 22:30
-
-
Save sebabouche/2cadcc8ffe3b059bd524663ee841cdd7 to your computer and use it in GitHub Desktop.
Using setTimeout with async/await
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
let wait = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
let foo = async () => { | |
await wait(2000) | |
await this._doSomething() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment