MCPcopy Create free account
hub / github.com/bvaughn/react-window / nextFrame

Function nextFrame

integrations/tests/tests/settle.ts:37–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 // WebKit on Linux (in CI) sometimes stops running animation frames;
36 // don't wait for more than a frame's worth of time (at a low frame rate)
37 const nextFrame = () =>
38 new Promise<void>((resolve) => {
39 const done = () => {
40 cancelAnimationFrame(animationFrameId);
41 clearTimeout(timeoutId);
42 resolve();
43 };
44 const animationFrameId = requestAnimationFrame(done);
45 const timeoutId = setTimeout(done, 50);
46 });
47
48 let snapshot = getSnapshot();
49 let unchangedFrames = 0;

Callers 1

settleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected