MCPcopy
hub / github.com/nilbuild/driver.js / flushFrames

Function flushFrames

tests/animation.test.ts:9–17  ·  view source on GitHub ↗
(predicate: () => boolean, maxFrames = 120)

Source from the content-addressed store, hash-verified

7// The animated stage transition settles over several frames, so polling beats a
8// fixed wait.
9async 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.

Callers 1

animation.test.tsFile · 0.85

Calls 1

nextFrameFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…