useThrottle
Deprecated
useThrottle has been renamed to
useThrottledValue and will be removed in a
future release. It is an alias with exactly the same behavior, and
UseThrottleOptions is an alias of UseThrottledValueOptions.
Migrating
// Before
import { useThrottle } from "@altalyst/hookify";
const throttled = useThrottle(value, 200, { leading: false });
// After
import { useThrottledValue } from "@altalyst/hookify";
const throttled = useThrottledValue(value, 200, { leading: false });
The new name says that it throttles a value, matching
useDebouncedValue and
useDebouncedCallback.