@appello/common
Version:
Common package with many useful features for web and mobile development
13 lines (12 loc) • 391 B
TypeScript
import { AnyFunction } from '../../types';
export type DebounceOptions = {
leading?: boolean;
trailing?: boolean;
maxWait?: number;
};
export declare function debounce<T extends AnyFunction>(func: T, wait?: number, options?: DebounceOptions): {
(...args: Parameters<T>): ReturnType<T> | undefined;
cancel: () => void;
flush: () => any;
pending: () => boolean;
};