useDebounce

A hook that handle the debounce value.

API is consistent with ahooks.

Examples

Default usage

API

const debouncedValue = useDebounce(
  value: any,
  options?: Options
);

Params

PropertyDescriptionTypeDefault
valuevalue that requires debounceany-
optionsConfig the debounce behavior. See the Options section below.Options{}

Options

PropertyDescriptionTypeDefault
waitThe number of milliseconds to delay.number1000
leadingSpecify invoking on the leading edge of the timeout.booleanfalse
trailingSpecify invoking on the trailing edge of the timeout.booleantrue

最近更新: