Function
waitForRouterCondition
(
description: string,
predicate: () => boolean
)
Source from the content-addressed store, hash-verified
| 57 | }); |
| 58 | |
| 59 | async function waitForRouterCondition( |
| 60 | description: string, |
| 61 | predicate: () => boolean |
| 62 | ): Promise<void> { |
| 63 | const deadline = Date.now() + 1_000; |
| 64 | while (Date.now() < deadline) { |
| 65 | if (predicate()) { |
| 66 | return; |
| 67 | } |
| 68 | await new Promise((resolve) => setTimeout(resolve, 10)); |
| 69 | } |
| 70 | throw new Error(`Timed out waiting for ${description}`); |
| 71 | } |
| 72 | |
| 73 | async function waitForRouterWorkflowStatus( |
| 74 | client: { |
Tested by
no test coverage detected