@ssts/wait
v0.0.2
Published
Promise wait | Good for development.
Downloads
10
Maintainers
Readme
Promise wait | Good for development.
One straight forward function ~~that~~ waits
| Good for development purposes 😍
Install
npm i -D @ssts/wait
Import
import seniorWAIT from "@ssts/wait";
Use
async function handleSomething(): Promise<void> {
await seniorWAIT(1000); // in milliseconds
}
Arguments
Returns Promise<void>
| Order | Parameter | Type | Default | | :---: | :-------: | :------: | :-------: | | 1 | duration | number | 5000 (ms) |
Example
import seniorWAIT from "@ssts/wait";
const handleSomething = async (): Promise<void> => {
try {
console.log("waiting started");
await seniorWAIT(2000); // in milliseconds (2 seconds)
console.log("waiting done");
await doSomething();
} catch (error) {
console.error(error);
}
}
Made With Chocolate By Senior Sedo 😎
Be Chocolateful 💙😍
ssts stands for senior-sedo-typescript 💙
So instead of ~~@senior-sedo-typescript/promise-wait~~
@ssts/wait
for simplicity sake 😍