Created
October 14, 2020 00:01
-
-
Save adelin-b/704f77c022f80633d1e1e20a0dcf4908 to your computer and use it in GitHub Desktop.
A timeout that can be awaited
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
/** | |
* A timeout that can be awaited | |
* @param {} ms | |
*/ | |
export function timeout(ms: number) { | |
return new Promise((resolve) => setTimeout(resolve, ms)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment