Skip to content

Instantly share code, notes, and snippets.

@adelin-b
Created October 14, 2020 00:01
Show Gist options
  • Save adelin-b/704f77c022f80633d1e1e20a0dcf4908 to your computer and use it in GitHub Desktop.
Save adelin-b/704f77c022f80633d1e1e20a0dcf4908 to your computer and use it in GitHub Desktop.
A timeout that can be awaited
/**
* 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