MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / waitFor

Function waitFor

test-hook-integration.mjs:136–143  ·  view source on GitHub ↗
(pred, ms = 1000)

Source from the content-addressed store, hash-verified

134}
135
136const waitFor = async (pred, ms = 1000) => {
137 const t0 = Date.now()
138 while (Date.now() - t0 < ms) {
139 if (pred()) return true
140 await new Promise((r) => setTimeout(r, 20))
141 }
142 return pred()
143}
144
145// F — SessionStart injects context into the first message of the session.
146{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected