UNPKG

@rocket.chat/fuselage-hooks

Version:

React hooks for Fuselage, Rocket.Chat's design system and UI toolkit

17 lines 588 B
import type { Dispatch, SetStateAction } from 'react'; /** * Hook to create a state with a debounced setter function. * * @param initialValue - the initial state value or the initial state generator function * @param delay - the number of milliseconds to delay the updater * @returns a state and debounced setter function * @public */ export declare function useDebouncedState<S>(initialValue: S | (() => S), delay: number): [ S, Dispatch<SetStateAction<S>> & { flush: () => void; cancel: () => void; } ]; //# sourceMappingURL=useDebouncedState.d.ts.map