Skip to content
On this page

useThrottle

A hook that deal with the throttled value.

Code demonstration

API

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

Params

PropertyDescriptionTypeDefault
valueThe value to throttle.Ref<any>-
optionsConfig for the throttle behaviors.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

Source

SourceDocsDemo