@univerjs/core v0.1.17 • Docs
Function: debounce()
function debounce<T>(func, wait): debounceFn<T> & {
cancel: () => void;
}
Creates a debounced function that delays invoking the provided function until after wait
milliseconds have elapsed since the last time the debounced function was invoked.
Type Parameters
Type Parameter | Description |
---|---|
T extends (...args ) => any | The type of the function to be debounced. |
Parameters
Parameter | Type | Description |
---|---|---|
func | T | The function to be debounced. |
wait | number | The number of milliseconds to wait before invoking the function. |
Returns
debounceFn
<T
> & {
cancel
: () => void
;
}
- The debounced function, which also has a
cancel
method to cancel the scheduled function call.
Defined in
submodules/univer/packages/core/src/shared/debounce.ts:26 (opens in a new tab)