Implement a hook useInterval(callback, delay) that repeatedly calls a given function at a specified interval.
The hook should:
Example
let count = 0; const stop = useInterval(() => { count += 1; }, 1000); setTimeout(() => { stop(); // stops the interval }, 5000);
JavaScript Function
No test results yet
Click "Run" to execute tests