MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / waitUntil

Function waitUntil

test/artifact-live-server.test.ts:25–32  ·  view source on GitHub ↗
(fn: () => boolean, ms = 4000)

Source from the content-addressed store, hash-verified

23});
24
25async function waitUntil(fn: () => boolean, ms = 4000): Promise<boolean> {
26 const t0 = Date.now();
27 while (Date.now() - t0 < ms) {
28 if (fn()) return true;
29 await new Promise(r => setTimeout(r, 25));
30 }
31 return fn();
32}
33
34/** Consume an SSE channel, counting `reload` events. Returns a stop() fn. */
35async function openSse(url: string, onReload: () => void): Promise<() => void> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected