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.17.1. This function has been downloaded 9 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 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.