π πͺ like a baby π©πΎβπΌ
The Ultimate package to sleep With this function ( sleep ), you can sleep the time you want !
Example
import sleep from '@bemedev/sleep';
const myCoolFunction = async () => {
// Go to sleep
await sleep(2); // 100 milliseconds by default
// Sleeping...
// Sleeping...
// And wake up !
console.log("I'm awake");
};
I don't know why the core-js team doesn't include this one. So I write the simplest package in the entire history of Javascript.
Enjoy your sleep
Maybe new ways to sleep will arrive soon