import { useRef as u, useEffect as s } from "react";
const f = (e, r) => {
  const t = u(null), n = u(e);
  return s(() => {
    n.current = e;
  }, [e]), s(() => {
    const o = () => n.current();
    if (typeof r == "number")
      return t.current = setInterval(o, r), () => clearInterval(t.current ?? void 0);
  }, [r]), t;
};
export {
  f as default
};
//# sourceMappingURL=useInterval.js.map
