API Reference
@univerjs
@univerjs/core
functions
Debounce

@univerjs/core v0.1.17Docs


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 ParameterDescription
T extends (...args) => anyThe type of the function to be debounced.

Parameters

ParameterTypeDescription
funcTThe function to be debounced.
waitnumberThe 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)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.