UNPKG

@arolariu/components

Version:

🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡

24 lines (23 loc) • 672 B
"use client"; import * as __rspack_external_react from "react"; function useInterval(callback, delay) { const savedCallbackRef = __rspack_external_react.useRef(callback); __rspack_external_react.useEffect(()=>{ savedCallbackRef.current = callback; }, [ callback ]); __rspack_external_react.useEffect(()=>{ if (null === delay) return; const intervalId = globalThis.setInterval(()=>{ savedCallbackRef.current(); }, delay); return ()=>{ globalThis.clearInterval(intervalId); }; }, [ delay ]); } export { useInterval }; //# sourceMappingURL=useInterval.js.map