MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / waitFor

Function waitFor

packages/vite/hmr/client/index.ts:1262–1269  ·  view source on GitHub ↗
(pred: () => boolean, ms = 6000, step = 60)

Source from the content-addressed store, hash-verified

1260 }
1261 };
1262 const waitFor = async (pred: () => boolean, ms = 6000, step = 60) => {
1263 const start = Date.now();
1264 while (Date.now() - start < ms) {
1265 if (pred()) return true;
1266 await new Promise((r) => setTimeout(r, step));
1267 }
1268 return pred();
1269 };
1270 const withEvents = async (ms = 6000) => {
1271 try {
1272 const a: any = (App as any).android;

Callers 1

withEventsFunction · 0.85

Calls 1

setTimeoutFunction · 0.50

Tested by

no test coverage detected