Skip to content

Instantly share code, notes, and snippets.

@malcolm-kee
Created December 30, 2018 16:19
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 malcolm-kee/8f3d2973872f0791ed5faea9cb4f1891 to your computer and use it in GitHub Desktop.
Save malcolm-kee/8f3d2973872f0791ed5faea9cb4f1891 to your computer and use it in GitHub Desktop.
A utility to slow down promise-based function
export const waitPromise = (promiseCall, amount = 0) => (...args) =>
new Promise(resolve => setTimeout(() => resolve(promiseCall(...args)), amount));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment