{"version":3,"file":"usePrevious.mjs","names":["useEffect","useRef","usePrevious","value","ref","current"],"sources":["../../src/utilities/usePrevious.js"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\n// Hook\nexport const usePrevious = (value) => {\n  // The ref object is a generic container whose current property is mutable ...\n  // ... and can hold any value, similar to an instance property on a class\n  const ref = useRef()\n\n  // Store current value in ref\n  useEffect(() => {\n    ref.current = value\n  }, [value]) // Only re-run if value changes\n\n  // Return previous value (happens before update in useEffect above)\n  return ref.current\n}\n"],"mappings":";;AAGA,MAAaE,eAAeC,UAAU;CAGpC,MAAMC,MAAMH,QAAQ;AAGpBD,iBAAgB;AACdI,MAAIC,UAAUF;IACb,CAACA,MAAM,CAAC;AAGX,QAAOC,IAAIC"}