useThrottleValue
Throttles state updates to a value so it changes at most once per wait milliseconds.
Loading preview...
The useThrottleValue hook throttles updates to a reactive value so it changes at most once every wait milliseconds, returning a [throttledValue, controls] tuple.
Installation
Usage
Examples
Throttling Live Slider Previews
Keep a range slider responsive while throttling expensive chart or preview re-renders to once every 150ms.
Controlling Trailing Updates via Setter Controls
Use the second tuple item to flush or cancel a pending trailing value update.
API Reference
ThrottleOptions
Configuration options for leading and trailing execution edges.
Property
Specification
leading?uniondefault:true
Invoke the function on the leading edge of the wait interval
Full Signature
trailing?uniondefault:true
Invoke the function on the trailing edge of the wait interval
Full Signature
ThrottledFunction
Throttled setter returned as the second tuple element.
Property
Specification
cancelrequiredfunction
Cancels any pending trailing invocation and resets the timer.
Full Signature
flushrequiredfunction
Immediately executes any pending trailing invocation.
Full Signature
isPendingrequiredfunction
Returns
true if a trailing invocation timer is currently active.Full Signature