All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.useBreakpoints.utils.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"utils.js","names":["subscribe","exports","listener","window","addEventListener","removeEventListener","getCurrentSize","breakpointOverrides","innerWidth","sizes","_objectSpread","mobile","tablet","desktop","largeDesktop","size","Object","keys","find","breakpoint"],"sources":["../../../../src/react-utils/useBreakpoints/utils.js"],"sourcesContent":["export const subscribe = listener => {\n  window.addEventListener(\"resize\", listener);\n\n  return () => window.removeEventListener(\"resize\", listener);\n};\n\nexport const getCurrentSize = (window, breakpointOverrides) => {\n  const { innerWidth } = window;\n  const sizes = {\n    mobile: innerWidth < 768,\n    tablet: innerWidth >= 768 && innerWidth < 1024,\n    desktop: innerWidth >= 1024 && innerWidth < 1280,\n    largeDesktop: innerWidth >= 1280,\n    ...breakpointOverrides?.(window),\n  };\n\n  const size = Object.keys(sizes).find(breakpoint => sizes[breakpoint]) || \"\";\n\n  return size;\n};\n"],"mappings":";;;;;;;;;;AAAO,IAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAZA,SAASA,CAAGE,QAAQ,EAAI;EACnCC,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEF,QAAQ,CAAC;EAE3C,OAAO;IAAA,OAAMC,MAAM,CAACE,mBAAmB,CAAC,QAAQ,EAAEH,QAAQ,CAAC;EAAA;AAC7D,CAAC;AAEM,IAAMI,cAAc,GAAAL,OAAA,CAAAK,cAAA,GAAG,SAAjBA,cAAcA,CAAIH,MAAM,EAAEI,mBAAmB,EAAK;EAC7D,IAAQC,UAAU,GAAKL,MAAM,CAArBK,UAAU;EAClB,IAAMC,KAAK,GAAAC,aAAA;IACTC,MAAM,EAAEH,UAAU,GAAG,GAAG;IACxBI,MAAM,EAAEJ,UAAU,IAAI,GAAG,IAAIA,UAAU,GAAG,IAAI;IAC9CK,OAAO,EAAEL,UAAU,IAAI,IAAI,IAAIA,UAAU,GAAG,IAAI;IAChDM,YAAY,EAAEN,UAAU,IAAI;EAAI,GAC7BD,mBAAmB,aAAnBA,mBAAmB,uBAAnBA,mBAAmB,CAAGJ,MAAM,CAAC,CACjC;EAED,IAAMY,IAAI,GAAGC,MAAM,CAACC,IAAI,CAACR,KAAK,CAAC,CAACS,IAAI,CAAC,UAAAC,UAAU;IAAA,OAAIV,KAAK,CAACU,UAAU,CAAC;EAAA,EAAC,IAAI,EAAE;EAE3E,OAAOJ,IAAI;AACb,CAAC","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy