Created
June 27, 2024 09:41
-
-
Save d1i1m1o1n/65d24826e0701a536222478d22484203 to your computer and use it in GitHub Desktop.
A simple way to create a helper to wait for a specified time. It can be useful for simulation of server response and other purposes during development.
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
const wait = async (milliseconds) => new Promise( | |
(resolve) => setTimeout(resolve, milliseconds) | |
); | |
wait(2000).then(doSomthing); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment