Function: createThrottle()
ts
function createThrottle(run, intervalMs, clock?): object;Experimental
Leading + trailing throttle: the first request after an idle period runs immediately; requests inside the interval coalesce into one trailing run, so the final state is always computed.
Parameters
| Parameter | Type | Default value |
|---|---|---|
run | () => void | undefined |
intervalMs | number | undefined |
clock | ThrottleClock | defaultClock |
Returns
object
| Name | Type |
|---|---|
cancel() | () => void |
flush() | () => void |
request() | () => void |