UNPKG

760 BTypeScriptView Raw
1import * as React from 'react';
2declare type UseEffectParams = Parameters<typeof React.useEffect>;
3declare type EffectCallback = UseEffectParams[0];
4declare type DependencyList = UseEffectParams[1];
5declare type UseEffectReturn = ReturnType<typeof React.useEffect>;
6/**
7 * @param value the value to be memoized (usually a dependency list)
8 * @returns a momoized version of the value as long as it remains deeply equal
9 */
10export declare function useDeepCompareMemoize<T>(value: T): T;
11declare function useDeepCompareEffect(callback: EffectCallback, dependencies: DependencyList): UseEffectReturn;
12export declare function useDeepCompareEffectNoCheck(callback: EffectCallback, dependencies: DependencyList): UseEffectReturn;
13export default useDeepCompareEffect;