(predicate: () => boolean, maxFrames = 120)
| 7 | // The animated stage transition settles over several frames, so polling beats a |
| 8 | // fixed wait. |
| 9 | async function flushFrames(predicate: () => boolean, maxFrames = 120): Promise<void> { |
| 10 | for (let i = 0; i < maxFrames; i++) { |
| 11 | if (predicate()) { |
| 12 | return; |
| 13 | } |
| 14 | await nextFrame(); |
| 15 | } |
| 16 | throw new Error("condition not met within frame budget"); |
| 17 | } |
| 18 | |
| 19 | // The library drives the CSS fade via a custom property on <body> so a single |
| 20 | // `duration` config controls both the JS stage slide and the CSS fade-in. |
no test coverage detected
searching dependent graphs…