/whendo

When a time-dependent condition is met, resolve a promise.

Primary LanguageJavaScript

Node.js CI

whendo

When a time-dependent condition is met, resolve a promise.

Usage

await whenDo(() => testIsTrue);
// ...
await whenTimeout(() => window.L, 'Leaflet');

// Use Leaflet (L).
const map = L.map('map').setView([51.505, -0.09], 13);
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>

License