Skip to content

Instantly share code, notes, and snippets.

@flekschas
Created July 15, 2018 22: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 flekschas/0c95aa32d175b1c3a2301ab5044b9380 to your computer and use it in GitHub Desktop.
Save flekschas/0c95aa32d175b1c3a2301ab5044b9380 to your computer and use it in GitHub Desktop.
Delay promise chain
const delayPromise = (duration) => (...args) => new Promise((resolve) => {
setTimeout(() => { resolve(...args); }, duration);
});
export default delayPromise;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment