Skip to content

Instantly share code, notes, and snippets.

@zerobias
Created January 4, 2017 15:28
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 zerobias/7080ba5c1f0b109d35148267fada3fd1 to your computer and use it in GitHub Desktop.
Save zerobias/7080ba5c1f0b109d35148267fada3fd1 to your computer and use it in GitHub Desktop.
Async pause
const resolver = delay => resolve => setTimeout(() => resolve(delay), delay)
const pause = (delay=5000) => new Promise(resolver(delay))
module.exports = pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment