Created
January 16, 2020 15:32
-
-
Save guillefd/9bdc05c8439f0e3070e09d84dbed26c7 to your computer and use it in GitHub Desktop.
Fake Delay
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
/** | |
* Fake a delay | |
* simulate a time delay and return promise | |
* | |
* @private | |
* @param {number} [duration=3000] | |
*/ | |
async function fakeDelay(duration = 3000) { | |
await new Promise(resolve => setTimeout(resolve, duration)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment