Creates a throttled version of a function which will only be executable once per every specified wait period.

This function is valid in v2.16.0 to v2.20.0. This function has been downloaded 18 times.


{Function} fn
The function which will esentially be rate-limited.
{number} msBetweenCalls
The amount of time to wait between calls.
{boolean=} opt_leading Optional, Default:undefined
If true the fn function will only be invoked on the initial calls if the specified time has elapsed since the last invocation. If false the fn function will only be invoked on the trailing calls. If not specified or if specified as null or undefined the initial calls and the trailing calls will be used to invoke fn.


The throttled version of fn function.

Required Function

This function requires the following function which is included automatically:

  • debounce()
    Creates a debounced copy of the function which when called will delay the execution until the specified amount of milliseconds have elapsed since the last time it was called.