MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / tick

Function tick

src/Components/Home/home.jsx:663–671  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

661 const start = performance.now();
662 const dur = 1200;
663 const tick = (t) => {
664 const p = Math.min((t - start) / dur, 1);
665 setN(Math.floor(p * value));
666 if (p < 1) {
667 raf = requestAnimationFrame(tick);
668 } else {
669 setN(value);
670 }
671 };
672 raf = requestAnimationFrame(tick);
673 return () => cancelAnimationFrame(raf);
674 }, [value]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected