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.

This function is valid in v2.16.0 to v2.24.3. This function has been downloaded 62 times.

Parameters

{Function} fnCallback
The function to debounce. The context and parameters sent to the debounced function will be sent to this function.
{number} msWait
The amount of milliseconds that must pass since the last call to this function before really invoking fnCallback.
{boolean=} opt_initialAndAfter Optional, Default:undefined
Specify true if both the initial calls and the trailing calls should invoke the fnCallback function. Specify false if only the initial calls should invoke the fnCallback function. If not specified or specified as null or undefined only the trailing calls will invoke fnCallback.

Returns

{Function}
The debounced copy of fnCallback.

Required Function

This function directly requires the following function which is included automatically:

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

Requiring Function

This function is directly required by the following function:

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