@knitui/hooks
useThrottledCallback
Throttle a callback — port of Mantine's useThrottledCallback. The returned function has a stable identity and always calls the latest callback. Pure timers, so identical on web and native — handy for high-frequency events (drag, scroll).
WebiOSAndroid
Import
import { useThrottledCallback } from "@knitui/hooks";Signature
export function useThrottledCallback<Args extends unknown[]>( callback: (...args: Args) => void, wait: number, ): (...args: Args) => void