{
  "mappings": "AAWA,OAAO,iBAAS,OAAO,GACrB,cAAc,GACd,oBACA,oCACO",
  "names": [],
  "sources": [
    "src/useGet.ts"
  ],
  "version": 3,
  "sourcesContent": [
    "import * as React from 'react'\n\n// useInsertionEffect ensures the ref is updated before any useLayoutEffect\n// reads the returned callback — fixes a React 19 timing issue where a\n// consumer's useLayoutEffect could fire before this ref update, causing stale\n// values. Falls back to useLayoutEffect for React < 18.3. No SSR branch: SSR\n// doesn't run layout effects, so the non-SSR path is correct everywhere.\nconst useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect\n\n// keeps a reference to the current value easily\n\nexport function useGet<A>(\n  currentValue: A,\n  initialValue?: any,\n  forwardToFunction?: boolean\n): () => A {\n  const curRef = React.useRef<any>(initialValue ?? currentValue)\n  useIsomorphicInsertionEffect(() => {\n    curRef.current = currentValue\n  })\n\n  return React.useCallback(\n    forwardToFunction\n      ? (...args) => curRef.current?.apply(null, args)\n      : () => curRef.current,\n    []\n  )\n}\n"
  ]
}