react-exo-hooks
Version:
A collection of useful hooks for data structures and logic, designed for efficiency
8 lines (7 loc) • 310 B
TypeScript
/**
* Debounced setState
* @param initial The initial state value
* @param timeoutMs The debounce interval
* @returns [state, setState, real]
*/
export declare function useDebouncedState<T>(initial: T, timeoutMs?: number): [state: T, setState: React.Dispatch<React.SetStateAction<T>>, real: T];