rollun-ts-utils
Version:
Simple JavaScript utils
17 lines (16 loc) • 460 B
TypeScript
/**
* waiter. it waits...
* Function return promise, that resolves in {duration} milliseconds.
* Usage Example:
* const foo = async () => {
* try {
* // will 'freeze' function execution for 1000 milliseconds
* await wait(1000);
* const data = await someAsyncDataFetch();
* } catch (e) {
* // some error handling...
* }
* }
*/
declare const wait: (duration: number) => Promise<unknown>;
export default wait;