MCPcopy Create free account
hub / github.com/Qinbf/groundmap / tick

Function tick

web/components/HashScroller.tsx:162–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160 const maxFrames = 40; // 约 650ms 兜底
161
162 const tick = () => {
163 totalFrames += 1;
164 if (totalFrames > maxFrames) {
165 onTimeout?.();
166 callback();
167 return;
168 }
169 const h = measure();
170 if (h === last) {
171 stableFrames += 1;
172 if (stableFrames >= 3) {
173 callback();
174 return;
175 }
176 } else {
177 last = h;
178 stableFrames = 0;
179 }
180 requestAnimationFrame(tick);
181 };
182 requestAnimationFrame(tick);
183}
184

Callers

nothing calls this directly

Calls 2

onTimeoutFunction · 0.85
measureFunction · 0.85

Tested by

no test coverage detected