Throttles a value
value: Any: The value to be throttledms: Number: The time in milliseconds to throttle
throttledValue: Any: The returned value after the throttling
import { useThrottle } from "react-recipes";
const App = ({ value }) => {
const throttledValue = useThrottle(value, 250);
return (
<>
<div>Value: {value}</div>
<div>Throttled value: {throttledValue}</div>
</>
);
};