{
  "name": "use-custom-compare-effect",
  "author": "Brendan Dash (https://shadcn-hooks.com)",
  "description": "A hook like useEffect but with a custom compare function",
  "files": [
    {
      "path": "registry/hooks/use-custom-compare-effect.ts",
      "content": "import { useEffect, useRef } from 'react'\nimport type { DependencyList, EffectCallback } from 'react'\n\nexport function useCustomCompareEffect<T extends DependencyList>(\n  effect: EffectCallback,\n  deps: T,\n  customCompare: (a: T, b: T) => boolean,\n) {\n  const ref = useRef<T>(deps)\n\n  if (!ref.current || !customCompare(ref.current, deps)) {\n    ref.current = deps\n  }\n\n  useEffect(effect, ref.current)\n}\n",
      "type": "registry:hook"
    }
  ],
  "type": "registry:hook"
}
