Created
December 30, 2018 16:19
-
-
Save malcolm-kee/8f3d2973872f0791ed5faea9cb4f1891 to your computer and use it in GitHub Desktop.
A utility to slow down promise-based function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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