Function: throttle()
throttle<
T
>(func
:T
,wait
:number
):ThrottleFn
<T
>
Creates a throttled function that only invokes func
at most once per
every wait
milliseconds. The throttled function comes with a flush
method to
reset the last time the throttled function was invoked.
Type Parameters
Type Parameter |
---|
T extends (...args : any []) => any |
Parameters
Parameter | Type | Description |
---|---|---|
func | T | The function to throttle. |
wait | number | The number of milliseconds to throttle invocations to. |
Returns
ThrottleFn
<T
>
Returns the new throttled function.