Last active
November 25, 2021 16:21
-
-
Save TheRolfFR/9e5056626063eb4cb032ea21c845f144 to your computer and use it in GitHub Desktop.
Resolves promise after certain period of time in ms
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
/** | |
* Resolves promise after certain period of time in ms | |
* @author TheRolf | |
* @param {Number} timeout delay in ms | |
*/ | |
const TimeoutPromise = function(timeout) { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(); | |
}, timeout); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment