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

Function ok

packages/vite/hmr/client/index.ts:509–518  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

507 const ready = async (ms = 8000, step = 60) => {
508 const start = Date.now();
509 const ok = () => {
510 try {
511 const a = (App as any).android;
512 const act = a && (a.foregroundActivity || a.startActivity);
513 const inProg = !!g.__NS_DEV_RESET_IN_PROGRESS__;
514 return !!act && !inProg;
515 } catch {
516 return false;
517 }
518 };
519 while (Date.now() - start < ms) {
520 if (ok()) return true;
521 await new Promise((r) => setTimeout(r, step));

Callers 1

readyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected