MCPcopy Create free account
hub / github.com/Noumena-Network/code / waitFor

Function waitFor

src/ink/selectionDragAutoscrollFlicker.test.tsx:124–135  ·  view source on GitHub ↗
(
  predicate: () => boolean,
  message: string,
  timeoutMs = 1500,
)

Source from the content-addressed store, hash-verified

122}
123
124async function waitFor(
125 predicate: () => boolean,
126 message: string,
127 timeoutMs = 1500,
128): Promise<void> {
129 const deadline = Date.now() + timeoutMs
130 while (Date.now() < deadline) {
131 if (predicate()) return
132 await Bun.sleep(10)
133 }
134 throw new Error(message)
135}
136
137function sgrMouse(
138 button: number,

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected