UNPKG

@blackglory/wait-for

Version:

A module for waiting for things to happen.

12 lines 437 B
import { setSchedule } from 'extra-timers'; export function waitForSchedule(timestamp, signal) { return new Promise((resolve, reject) => { signal?.throwIfAborted(); const clearSchedule = setSchedule(timestamp, resolve); signal?.addEventListener('abort', () => { clearSchedule(); reject(signal.reason); }, { once: true }); }); } //# sourceMappingURL=wait-for-schedule.js.map