Skip to main content

Interface: DebouncedFunc()<FnArgumentsType, FnReturnType>

Defined in: debounce/debounce.ts:24

Type Parameters

Type Parameter
FnArgumentsType extends any[]
FnReturnType

DebouncedFunc(...args: FnArgumentsType): undefined | FnReturnType

Defined in: debounce/debounce.ts:34

Call the original function, but applying the debounce rules.

If the debounced function can be run immediately, this calls it and returns its return value.

Otherwise, it returns the return value of the last invocation, or undefined if the debounced function was not invoked yet.

Parameters

ParameterType
...argsFnArgumentsType

Returns

undefined | FnReturnType

Methods

cancel()

cancel(): void

Defined in: debounce/debounce.ts:39

Throw away any pending invocation of the debounced function.

Returns

void


flush()

flush(): undefined | FnReturnType

Defined in: debounce/debounce.ts:48

If there is a pending invocation of the debounced function, invoke it immediately and return its return value.

Otherwise, return the value from the last invocation, or undefined if the debounced function was never invoked.

Returns

undefined | FnReturnType