{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-throttled-memo",
  "title": "useThrottledMemo",
  "description": "A hook to throttle a memo",
  "registryDependencies": [
    "https://hookas.letstri.dev/r/use-throttled-callback.json"
  ],
  "files": [
    {
      "path": "registry/hooks/use-throttled-memo.ts",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { useThrottledCallback } from './use-throttled-callback'\n\nexport function useThrottledMemo<T>(factory: () => T, deps: React.DependencyList, delay: number) {\n  const [state, setState] = React.useState<T>(() => factory())\n\n  const throttledSetState = useThrottledCallback((value: T) => {\n    setState(value)\n  }, [setState], delay)\n\n  React.useEffect(() => {\n    throttledSetState(factory())\n  }, [...deps, throttledSetState])\n\n  return state\n}\n",
      "type": "registry:hook",
      "target": "hookas/use-throttled-memo.ts"
    }
  ],
  "type": "registry:hook"
}