import { useCallback } from 'react' ; import { checkDeps , useDeepCompareMemoize } from './useDeepCompareMemoize' ; import { isDev } from '@/utils/env' ; export function useDeepCompareCallback < T extends ( ... args : any [ ] ) => any > ( callback , dependencies ) { if ( isDev ) { checkDeps ( dependencies , 'useDeepCompareCallback' ) ; } return useCallback ( callback , useDeepCompareMemoize ( dependencies ) ) ; }