Skip to content

Instantly share code, notes, and snippets.

@73nko
Created March 13, 2018 14:24
Show Gist options
  • Save 73nko/25845f0ffa7c87d22807030d58210770 to your computer and use it in GitHub Desktop.
Save 73nko/25845f0ffa7c87d22807030d58210770 to your computer and use it in GitHub Desktop.
A small function to promisify SetTimeout and use it with async await
const timer = time =>
new Promise(resolve => setTimeout(resolve, time));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment