Skip to content

Instantly share code, notes, and snippets.

@schahriar
Created January 14, 2018 22:02
Show Gist options
  • Save schahriar/5f734f3bdcb2c301fc005295e97fb308 to your computer and use it in GitHub Desktop.
Save schahriar/5f734f3bdcb2c301fc005295e97fb308 to your computer and use it in GitHub Desktop.
Control flow timers in action #async-await #medium
const z = async () => {
await x();
await timeoutPromise(1000); // Wait 1 second
// You can recurse z if needed
return y();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment