MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / startTimer

Function startTimer

message-component/src/Message/useTimer.tsx:14–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 const timer = useRef<number | null>(null);
13
14 const startTimer = () => {
15 timer.current = window.setTimeout(() => {
16 remove(id);
17 removeTimer();
18 }, duration);
19 };
20
21 const removeTimer = () => {
22 if (timer.current) {

Callers 2

useTimerFunction · 0.70
onMouseLeaveFunction · 0.70

Calls 1

removeTimerFunction · 0.70

Tested by

no test coverage detected