MCPcopy Index your code
hub / github.com/streamich/react-use / onFrame

Function onFrame

src/useRaf.ts:12–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 let start;
11
12 const onFrame = () => {
13 const time = Math.min(1, (Date.now() - start) / ms);
14 set(time);
15 loop();
16 };
17 const loop = () => {
18 raf = requestAnimationFrame(onFrame);
19 };

Callers

nothing calls this directly

Calls 2

loopFunction · 0.85
setFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…