UNPKG

@kirz/react-native-toolkit

Version:

Toolkit to speed up React Native development

12 lines 340 B
import { wait } from './wait'; export async function waitUntil(fn, timeout, retries) { for (let i = 0; retries == null || i < retries; i++) { const result = await fn(); if (result) { return; } await wait(timeout ?? 1000); } throw new Error('Max retries attempts reached'); } //# sourceMappingURL=waitUntil.js.map