Create a function useThrottle(fn, delay) that returns a throttled version of the provided function.
The throttled function should only be invoked at most once every delay milliseconds, even if it's called repeatedly in that time frame.
Example
const throttledLog = useThrottle(console.log, 1000); throttledLog("hello"); // logs immediately throttledLog("world"); // ignored if within 1s
JavaScript Function
No test results yet
Click "Run" to execute tests