@kirz/react-native-toolkit
Version:
Toolkit to speed up React Native development
18 lines (17 loc) • 455 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.waitUntil = waitUntil;
var _wait = require("./wait");
async function waitUntil(fn, timeout, retries) {
for (let i = 0; retries == null || i < retries; i++) {
const result = await fn();
if (result) {
return;
}
await (0, _wait.wait)(timeout ?? 1000);
}
throw new Error('Max retries attempts reached');
}
//# sourceMappingURL=waitUntil.js.map