react-timing-hooks icon indicating copy to clipboard operation
react-timing-hooks copied to clipboard

useDebouncedState()

Open EricLambrecht opened this issue 1 year ago • 0 comments

Status Quo / Problem / Topic useDebounce() often is used in conjunction with useState(). Combine the two.

Solution A combination of useDebounce() and useState() called useDebouncedState() (Similar to the already existing useThrottledState()).

API proposal:

const [value, setValue] = useDebouncedState(initialState, debounceTimeMs, options = {})

EricLambrecht avatar Aug 04 '24 12:08 EricLambrecht