{
  "version": 3,
  "sources": ["../../../src/utility-hooks/use-stable-value.ts"],
  "sourcesContent": ["import { useRef } from 'react';\n\nimport { areEqual } from '../config/are-equal.mjs';\n\n/**\n * Remembers the specified value across renders and compares it against a stored value, which is returned.  The stored value is only updated\n * if the specified value really changes, using `areEqual` to compare.\n */\nexport const useStableValue = <T>(instableValue: T) => {\n  const stableValue = useRef<T>(instableValue);\n\n  if (!areEqual(instableValue, stableValue.current)) {\n    stableValue.current = instableValue;\n  }\n\n  return stableValue.current;\n};\n"],
  "mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AAMlB,MAAM,iBAAiB,CAAI,kBAAqB;AACrD,QAAM,cAAc,OAAU,aAAa;AAE3C,MAAI,CAAC,SAAS,eAAe,YAAY,OAAO,GAAG;AACjD,gBAAY,UAAU;AAAA,EACxB;AAEA,SAAO,YAAY;AACrB;",
  "names": []
}
