UNPKG

@studio-lumio/hooks

Version:

a compilation of react hooks we use to make our magic

16 lines (15 loc) 875 B
export declare function throttle(cb: { (e: any): void; (): void; }, ms: number): () => void; type DebouncedFunction<T extends (...args: any[]) => any> = T & { cancel: () => void; flush: () => void; }; export declare function debounce<T extends (...args: any[]) => any>(fn: T, wait: number, callFirst?: boolean): DebouncedFunction<T>; export declare const noop: () => void; export declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, Function | null, ...any]): void; export declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, Function | null, ...any]): void; export declare const isBrowser: boolean; export declare const isNavigator: boolean; export {};