MCPcopy
hub / github.com/xnimorz/use-debounce / startTimer

Function startTimer

src/useDebouncedCallback.ts:187–192  ·  view source on GitHub ↗
(pendingFunc: () => void, wait: number)

Source from the content-addressed store, hash-verified

185 };
186
187 const startTimer = (pendingFunc: () => void, wait: number) => {
188 if (useRAF) cancelAnimationFrame(timerId.current);
189 timerId.current = useRAF
190 ? requestAnimationFrame(pendingFunc)
191 : setTimeout(pendingFunc, wait);
192 };
193
194 const shouldInvoke = (time: number) => {
195 if (!mounted.current) return false;

Callers 2

timerExpiredFunction · 0.85
funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…