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! ⚡

20 lines (19 loc) • 564 B
"use client"; import * as __rspack_external_react from "react"; function useDebounce(value, delay) { const [debouncedValue, setDebouncedValue] = __rspack_external_react.useState(value); __rspack_external_react.useEffect(()=>{ const timeoutId = globalThis.setTimeout(()=>{ setDebouncedValue(value); }, delay); return ()=>{ globalThis.clearTimeout(timeoutId); }; }, [ value, delay ]); return debouncedValue; } export { useDebounce }; //# sourceMappingURL=useDebounce.js.map