UNPKG

@storm-stack/hooks

Version:

A collection of React hooks used by Storm Software in various client libraries and applications.

10 lines (9 loc) 499 B
import { DebounceOptions } from "@storm-stack/utilities/helper-fns/debounce"; export declare function useDebounce<A extends (...args: any) => any | undefined | null, DebouncedFn extends A & { cancel: () => void; }>(fn: A, wait: number, options?: DebounceOptions, mountArgs?: any[]): DebouncedFn; /** * Returns a value once it stops changing after "amt" time. * Note: you may need to memo or this will keep re-rendering */ export declare function useDebounceValue<A>(val: A, amt?: number): A;