debounce
FitFileViewer - API Documentation v29.4.0
FitFileViewer - API Documentation / utils/app/performance/performanceUtils / debounce
Function: debounce()
debounce<
T>(func:T,wait:number,options?: {leading?:boolean;trailing?:boolean; }):T& {cancel: () =>void;flush: () =>void; }
Defined in: utils/app/performance/performanceUtils.js:64
Debounce a function
Type Parametersβ
Tβ
T extends (...args: any[]) => any
Parametersβ
funcβ
T
Function to debounce
waitβ
number
Wait time in milliseconds
options?β
Options
leading?β
boolean
Execute on leading edge
trailing?β
boolean
Execute on trailing edge
Returnsβ
T & { cancel: () => void; flush: () => void; }
Debounced function with cancel and flush methods