import type {
  DependencyList,
  EffectCallback,
} from 'react';
import { isEqual } from '@zhst/func';
import useCustomCompareEffect from '../useCustomCompareEffect';

function useDeepEffect(effect: EffectCallback, deps: DependencyList) {
  useCustomCompareEffect(effect, deps, (pre, now) => {
    return isEqual(pre, now);
  });
}

export default useDeepEffect;
