1 line
2.9 KiB
JSON
1 line
2.9 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nimport { useRef } from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport useForceUpdate from '../../_util/hooks/useForceUpdate';\nimport useResponsiveObserver from '../../_util/responsiveObserver';\nfunction useBreakpoint() {\n let refreshOnChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n const screensRef = useRef({});\n const forceUpdate = useForceUpdate();\n const responsiveObserver = useResponsiveObserver();\n useLayoutEffect(() => {\n const token = responsiveObserver.subscribe(supportScreens => {\n screensRef.current = supportScreens;\n if (refreshOnChange) {\n forceUpdate();\n }\n });\n return () => responsiveObserver.unsubscribe(token);\n }, []);\n return screensRef.current;\n}\nexport default useBreakpoint;","map":{"version":3,"names":["useRef","useLayoutEffect","useForceUpdate","useResponsiveObserver","useBreakpoint","refreshOnChange","arguments","length","undefined","screensRef","forceUpdate","responsiveObserver","token","subscribe","supportScreens","current","unsubscribe"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/grid/hooks/useBreakpoint.js"],"sourcesContent":["\"use client\";\n\nimport { useRef } from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport useForceUpdate from '../../_util/hooks/useForceUpdate';\nimport useResponsiveObserver from '../../_util/responsiveObserver';\nfunction useBreakpoint() {\n let refreshOnChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n const screensRef = useRef({});\n const forceUpdate = useForceUpdate();\n const responsiveObserver = useResponsiveObserver();\n useLayoutEffect(() => {\n const token = responsiveObserver.subscribe(supportScreens => {\n screensRef.current = supportScreens;\n if (refreshOnChange) {\n forceUpdate();\n }\n });\n return () => responsiveObserver.unsubscribe(token);\n }, []);\n return screensRef.current;\n}\nexport default useBreakpoint;"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,MAAM,QAAQ,OAAO;AAC9B,OAAOC,eAAe,MAAM,kCAAkC;AAC9D,OAAOC,cAAc,MAAM,kCAAkC;AAC7D,OAAOC,qBAAqB,MAAM,gCAAgC;AAClE,SAASC,aAAaA,CAAA,EAAG;EACvB,IAAIC,eAAe,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAKE,SAAS,GAAGF,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;EAC9F,MAAMG,UAAU,GAAGT,MAAM,CAAC,CAAC,CAAC,CAAC;EAC7B,MAAMU,WAAW,GAAGR,cAAc,CAAC,CAAC;EACpC,MAAMS,kBAAkB,GAAGR,qBAAqB,CAAC,CAAC;EAClDF,eAAe,CAAC,MAAM;IACpB,MAAMW,KAAK,GAAGD,kBAAkB,CAACE,SAAS,CAACC,cAAc,IAAI;MAC3DL,UAAU,CAACM,OAAO,GAAGD,cAAc;MACnC,IAAIT,eAAe,EAAE;QACnBK,WAAW,CAAC,CAAC;MACf;IACF,CAAC,CAAC;IACF,OAAO,MAAMC,kBAAkB,CAACK,WAAW,CAACJ,KAAK,CAAC;EACpD,CAAC,EAAE,EAAE,CAAC;EACN,OAAOH,UAAU,CAACM,OAAO;AAC3B;AACA,eAAeX,aAAa","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|