MCPcopy Index your code
hub / github.com/anomalyco/opencode / waitFor

Function waitFor

packages/opencode/test/plugin/openai-ws.test.ts:878–884  ·  view source on GitHub ↗
(predicate: () => boolean, message: string)

Source from the content-addressed store, hash-verified

876}
877
878async function waitFor(predicate: () => boolean, message: string) {
879 const started = Date.now()
880 while (!predicate()) {
881 if (Date.now() - started > 1_000) throw new Error(message)
882 await new Promise((resolve) => setTimeout(resolve, 1))
883 }
884}

Callers 1

openai-ws.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected