useThrottle

A hook that handle the throttle value.

API is consistent with ahooks.

Examples

Basic usage

API

const throttledValue = useThrottle(
  value: any,
  options?: object
);

Params

PropertyDescriptionTypeDefault
valuevalue that requires throttleany-
optionsConfig the throttle 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.booleantrue
trailingSpecify invoking on the trailing edge of the timeout.booleantrue

最近更新: