import { useEffect } from "react"

export const useInterval = (callback: () => void, delayMs: number) => {
    useEffect(() => {
        const intervalId = setInterval(callback, delayMs);
        return () => clearInterval(intervalId);
    }, [callback, delayMs])
}