PromoCursed/node_modules/.cache/babel-loader/a8feaeb32f74c8e789623dce9950e9c36403d84514a84f7b980f075d21733153.json
2024-08-20 23:25:37 +04:00

1 line
2.5 KiB
JSON

{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\n\n/**\n * Trigger only when component unmount\n */\nexport default function useUnmount(triggerStart, triggerEnd) {\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n firstMount = _React$useState2[0],\n setFirstMount = _React$useState2[1];\n useLayoutEffect(function () {\n if (firstMount) {\n triggerStart();\n return function () {\n triggerEnd();\n };\n }\n }, [firstMount]);\n useLayoutEffect(function () {\n setFirstMount(true);\n return function () {\n setFirstMount(false);\n };\n }, []);\n}","map":{"version":3,"names":["_slicedToArray","React","useLayoutEffect","useUnmount","triggerStart","triggerEnd","_React$useState","useState","_React$useState2","firstMount","setFirstMount"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-tree/es/useUnmount.js"],"sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\n\n/**\n * Trigger only when component unmount\n */\nexport default function useUnmount(triggerStart, triggerEnd) {\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n firstMount = _React$useState2[0],\n setFirstMount = _React$useState2[1];\n useLayoutEffect(function () {\n if (firstMount) {\n triggerStart();\n return function () {\n triggerEnd();\n };\n }\n }, [firstMount]);\n useLayoutEffect(function () {\n setFirstMount(true);\n return function () {\n setFirstMount(false);\n };\n }, []);\n}"],"mappings":"AAAA,OAAOA,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,MAAM,kCAAkC;;AAE9D;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAACC,YAAY,EAAEC,UAAU,EAAE;EAC3D,IAAIC,eAAe,GAAGL,KAAK,CAACM,QAAQ,CAAC,KAAK,CAAC;IACzCC,gBAAgB,GAAGR,cAAc,CAACM,eAAe,EAAE,CAAC,CAAC;IACrDG,UAAU,GAAGD,gBAAgB,CAAC,CAAC,CAAC;IAChCE,aAAa,GAAGF,gBAAgB,CAAC,CAAC,CAAC;EACrCN,eAAe,CAAC,YAAY;IAC1B,IAAIO,UAAU,EAAE;MACdL,YAAY,CAAC,CAAC;MACd,OAAO,YAAY;QACjBC,UAAU,CAAC,CAAC;MACd,CAAC;IACH;EACF,CAAC,EAAE,CAACI,UAAU,CAAC,CAAC;EAChBP,eAAe,CAAC,YAAY;IAC1BQ,aAAa,CAAC,IAAI,CAAC;IACnB,OAAO,YAAY;MACjBA,aAAa,CAAC,KAAK,CAAC;IACtB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}