Skip to content

Instantly share code, notes, and snippets.

@sebabouche
Created January 31, 2018 22:30
Show Gist options
  • Save sebabouche/2cadcc8ffe3b059bd524663ee841cdd7 to your computer and use it in GitHub Desktop.
Save sebabouche/2cadcc8ffe3b059bd524663ee841cdd7 to your computer and use it in GitHub Desktop.
Using setTimeout with async/await
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