Returns a throttled version of fn that can be called at most once per limit ms.
fn
limit
The function to throttle.
Minimum interval in milliseconds between calls.
const handleScroll = throttle(() => updatePosition(), 100)// updatePosition is called at most once every 100ms Copy
const handleScroll = throttle(() => updatePosition(), 100)// updatePosition is called at most once every 100ms
Returns a throttled version of
fnthat can be called at most once perlimitms.