{"ast":null,"code":"'use strict';\n\nimport Dimensions from \"../Dimensions\";\nimport { useEffect, useState } from 'react';\nexport default function useWindowDimensions() {\n  var _useState = useState(function () {\n    return Dimensions.get('window');\n  }),\n      dims = _useState[0],\n      setDims = _useState[1];\n\n  useEffect(function () {\n    function handleChange(_ref) {\n      var window = _ref.window;\n      setDims(window);\n    }\n\n    Dimensions.addEventListener('change', handleChange);\n    setDims(Dimensions.get('window'));\n    return function () {\n      Dimensions.removeEventListener('change', handleChange);\n    };\n  }, []);\n  return dims;\n}","map":{"version":3,"sources":["/Users/nishan/Desktop/oss/responsive-breakpoints/example/node_modules/react-native-web/dist/exports/useWindowDimensions/index.js"],"names":["Dimensions","useEffect","useState","useWindowDimensions","_useState","get","dims","setDims","handleChange","_ref","window","addEventListener","removeEventListener"],"mappings":"AASA;;AAEA,OAAOA,UAAP;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,OAApC;AACA,eAAe,SAASC,mBAAT,GAA+B;AAC5C,MAAIC,SAAS,GAAGF,QAAQ,CAAC,YAAY;AACnC,WAAOF,UAAU,CAACK,GAAX,CAAe,QAAf,CAAP;AACD,GAFuB,CAAxB;AAAA,MAGIC,IAAI,GAAGF,SAAS,CAAC,CAAD,CAHpB;AAAA,MAIIG,OAAO,GAAGH,SAAS,CAAC,CAAD,CAJvB;;AAMAH,EAAAA,SAAS,CAAC,YAAY;AACpB,aAASO,YAAT,CAAsBC,IAAtB,EAA4B;AAC1B,UAAIC,MAAM,GAAGD,IAAI,CAACC,MAAlB;AAEAH,MAAAA,OAAO,CAACG,MAAD,CAAP;AACD;;AAEDV,IAAAA,UAAU,CAACW,gBAAX,CAA4B,QAA5B,EAAsCH,YAAtC;AAIAD,IAAAA,OAAO,CAACP,UAAU,CAACK,GAAX,CAAe,QAAf,CAAD,CAAP;AACA,WAAO,YAAY;AACjBL,MAAAA,UAAU,CAACY,mBAAX,CAA+B,QAA/B,EAAyCJ,YAAzC;AACD,KAFD;AAGD,GAfQ,EAeN,EAfM,CAAT;AAgBA,SAAOF,IAAP;AACD","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * \n */\n'use strict';\n\nimport Dimensions from '../Dimensions';\nimport { useEffect, useState } from 'react';\nexport default function useWindowDimensions() {\n  var _useState = useState(function () {\n    return Dimensions.get('window');\n  }),\n      dims = _useState[0],\n      setDims = _useState[1];\n\n  useEffect(function () {\n    function handleChange(_ref) {\n      var window = _ref.window;\n      // $FlowFixMe\n      setDims(window);\n    }\n\n    Dimensions.addEventListener('change', handleChange); // We might have missed an update between calling `get` in render and\n    // `addEventListener` in this handler, so we set it here. If there was\n    // no change, React will filter out this update as a no-op.\n\n    setDims(Dimensions.get('window'));\n    return function () {\n      Dimensions.removeEventListener('change', handleChange);\n    };\n  }, []);\n  return dims;\n}"]},"metadata":{},"sourceType":"module"}