Skip to content

Instantly share code, notes, and snippets.

@brettz9
Created April 24, 2019 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettz9/994744472e1ed4347c17f65dd1f41924 to your computer and use it in GitHub Desktop.
Save brettz9/994744472e1ed4347c17f65dd1f41924 to your computer and use it in GitHub Desktop.
timeout
const timeout = (delay) => {
// eslint-disable-next-line promise/avoid-new
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, delay || 0);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment