Last active
August 8, 2019 09:19
-
-
Save sosmii/8f6a27f1ed6bb1460620e7cfdc03b463 to your computer and use it in GitHub Desktop.
a small util that let you sleep with async/await
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
module.exports = async milliSecond => { | |
return new Promise(resolve => setTimeout(resolve, milliSecond)); | |
} |
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
export default async (milliSecond: number) => { | |
return new Promise(resolve => setTimeout(resolve, milliSecond)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment