()
| 9 | const intrervalIdRef = useRef(null); |
| 10 | |
| 11 | function handleStart(){ |
| 12 | |
| 13 | if(intrervalIdRef.current!=null){ |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | intrervalIdRef.current = setInterval(()=>{ |
| 18 | setTime(time=>time+1); |
| 19 | },1000); |
| 20 | } |
| 21 | |
| 22 | function handleStop(){ |
| 23 | clearInterval(intrervalIdRef.current); |
nothing calls this directly
no outgoing calls
no test coverage detected