UNPKG

@gecut/utilities

Version:

The ultimate utility toolkit from Gecut Company, crafted with TypeScript for optimal speed and efficiency. Designed to boost productivity with a suite of fast and optimized tools.

14 lines 588 B
import { nextAnimationFrame, nextIdleCallback } from './polyfill.js'; export async function untilMS(delayMS) { return new Promise((resolve) => setTimeout(resolve, delayMS)); } export async function untilNextFrame() { return new Promise((resolve) => nextAnimationFrame(resolve)); } export async function untilIdle() { return new Promise((resolve) => nextIdleCallback(resolve)); } export function untilEvent(element, eventName) { return new Promise((resolve) => element.addEventListener(eventName, resolve, { once: true, passive: true })); } //# sourceMappingURL=wait.js.map