@knitui/hooks
useDebouncedCallback
Debounce a callback — port of Mantine's useDebouncedCallback. The returned function keeps a stable identity, always calls the latest callback (via useCallbackRef), and carries cancel / flush. The pending timer is cleared on unmount. Pure timers, so identical on web and native.
WebiOSAndroid
Import
import { useDebouncedCallback } from "@knitui/hooks";Signature
export function useDebouncedCallback<Args extends unknown[]>( callback: (...args: Args) => void, delay: number, ): DebouncedFunction<Args>Exported types: DebouncedFunction