8349e4191eccbf39b44d86be4be40fa3.json
2.18 KB
{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useEffect, useState, useRef } from 'react';\nexport default function useMountStatus(defaultValue) {\n var destroyRef = useRef(false);\n\n var _useState = useState(defaultValue),\n _useState2 = _slicedToArray(_useState, 2),\n val = _useState2[0],\n setVal = _useState2[1];\n\n function setValue(next) {\n if (!destroyRef.current) {\n setVal(next);\n }\n }\n\n useEffect(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n return [val, setValue];\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-motion/es/hooks/useState.js"],"names":["_slicedToArray","useEffect","useState","useRef","useMountStatus","defaultValue","destroyRef","_useState","_useState2","val","setVal","setValue","next","current"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,0CAA3B;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,MAA9B,QAA4C,OAA5C;AACA,eAAe,SAASC,cAAT,CAAwBC,YAAxB,EAAsC;AACnD,MAAIC,UAAU,GAAGH,MAAM,CAAC,KAAD,CAAvB;;AAEA,MAAII,SAAS,GAAGL,QAAQ,CAACG,YAAD,CAAxB;AAAA,MACIG,UAAU,GAAGR,cAAc,CAACO,SAAD,EAAY,CAAZ,CAD/B;AAAA,MAEIE,GAAG,GAAGD,UAAU,CAAC,CAAD,CAFpB;AAAA,MAGIE,MAAM,GAAGF,UAAU,CAAC,CAAD,CAHvB;;AAKA,WAASG,QAAT,CAAkBC,IAAlB,EAAwB;AACtB,QAAI,CAACN,UAAU,CAACO,OAAhB,EAAyB;AACvBH,MAAAA,MAAM,CAACE,IAAD,CAAN;AACD;AACF;;AAEDX,EAAAA,SAAS,CAAC,YAAY;AACpB,WAAO,YAAY;AACjBK,MAAAA,UAAU,CAACO,OAAX,GAAqB,IAArB;AACD,KAFD;AAGD,GAJQ,EAIN,EAJM,CAAT;AAKA,SAAO,CAACJ,GAAD,EAAME,QAAN,CAAP;AACD","sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useEffect, useState, useRef } from 'react';\nexport default function useMountStatus(defaultValue) {\n var destroyRef = useRef(false);\n\n var _useState = useState(defaultValue),\n _useState2 = _slicedToArray(_useState, 2),\n val = _useState2[0],\n setVal = _useState2[1];\n\n function setValue(next) {\n if (!destroyRef.current) {\n setVal(next);\n }\n }\n\n useEffect(function () {\n return function () {\n destroyRef.current = true;\n };\n }, []);\n return [val, setValue];\n}"]},"metadata":{},"sourceType":"module"}