{"version":3,"file":"useWillUnmount-7a08af3c.js","sources":["../../../../../../app/node_modules/@restart/hooks/esm/useUpdatedRef.js","../../../../../../app/node_modules/@restart/hooks/esm/useWillUnmount.js"],"sourcesContent":["import { useRef } from 'react';\n\n/**\n * Returns a ref that is immediately updated with the new value\n *\n * @param value The Ref value\n * @category refs\n */\nexport default function useUpdatedRef(value) {\n const valueRef = useRef(value);\n valueRef.current = value;\n return valueRef;\n}","import useUpdatedRef from './useUpdatedRef';\nimport { useEffect } from 'react';\n\n/**\n * Attach a callback that fires when a component unmounts\n *\n * @param fn Handler to run when the component unmounts\n * @category effects\n */\nexport default function useWillUnmount(fn) {\n const onUnmount = useUpdatedRef(fn);\n useEffect(() => () => onUnmount.current(), []);\n}"],"names":["useUpdatedRef","value","valueRef","useRef","useWillUnmount","fn","onUnmount","useEffect"],"mappings":"wCAQe,SAASA,EAAcC,EAAO,CAC3C,MAAMC,EAAWC,SAAOF,CAAK,EAC7B,OAAAC,EAAS,QAAUD,EACZC,CACT,CCHe,SAASE,EAAeC,EAAI,CACzC,MAAMC,EAAYN,EAAcK,CAAE,EAClCE,EAAAA,UAAU,IAAM,IAAMD,EAAU,QAAS,EAAE,CAAE,CAAA,CAC/C","x_google_ignoreList":[0,1]}