/** * Hook that throttles a value * * @template T - The type of the value * @param value - The value to throttle * @param delay - Throttle delay in milliseconds (default: 500) * @returns The throttled value * * @example * ```tsx * const Component = () => { * const [scrollY, setScrollY] = useState(0); * const throttledScrollY = useThrottle(scrollY, 100); * * useEffect(() => { * const handler = () => setScrollY(window.scrollY); * window.addEventListener('scroll', handler); * return () => window.removeEventListener('scroll', handler); * }, []); * * return