Category
Function
Utilities for function control flow
debounce
Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: { leading?: boolean; trailing?: boolean; maxWait?: number }): T & { cancel: () => void; flush: () => void }
throttle
Creates a throttled function that only invokes func at most once per every wait milliseconds.
throttle<T extends (...args: any[]) => any>(func: T, wait?: number, options?: { leading?: boolean; trailing?: boolean }): T & { cancel: () => void }
memoize
Creates a function that memoizes the result of func. If resolver is provided, it determines the cache key for storing the result based on the arguments provided to the memoized function.
memoize<T extends (...args: any[]) => any>(func: T, resolver?: (...args: Parameters<T>) => any): T & { cache: Map<any, any> }