UNPKG

@tempots/std

Version:

Std library for TypeScript. Natural complement to the Tempo libraries.

10 lines (9 loc) 241 B
const n = (t, { abortSignal: e } = {}) => new Promise((o, r) => { const i = setTimeout(o, t); e && e.addEventListener("abort", () => { clearTimeout(i), r(new DOMException("Aborted", "AbortError")); }); }); export { n as sleep };