Skip to content

Instantly share code, notes, and snippets.

@jdjuan
Created March 29, 2020 10:41
Show Gist options
  • Save jdjuan/a388467db05594efdd9ff2d4a0e886c2 to your computer and use it in GitHub Desktop.
Save jdjuan/a388467db05594efdd9ff2d4a0e886c2 to your computer and use it in GitHub Desktop.
Improve readability of setTimeout(fn, 0)
wait(): Promise<void> {
return new Promise((resolve: () => void): void => {
setTimeout(resolve);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment