package.react-utils.useBreakpoints.index.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"index.js","names":["useSyncExternalStore","equals","getCurrentSize","subscribe","useBreakpoints","breakpointOverrides","getSnapshot","window","currentSize","isSize"],"sources":["../../../src/react-utils/useBreakpoints/index.js"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nimport { equals } from \"ramda\";\n\nimport { getCurrentSize, subscribe } from \"./utils\";\n\nconst useBreakpoints = breakpointOverrides => {\n const getSnapshot = () => getCurrentSize(window, breakpointOverrides);\n const currentSize = useSyncExternalStore(subscribe, getSnapshot);\n\n return { currentSize, isSize: equals(currentSize) };\n};\n\nexport default useBreakpoints;\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAE5C,SAASC,MAAM,QAAQ,OAAO;AAE9B,SAASC,cAAc,EAAEC,SAAS;AAElC,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAGC,mBAAmB,EAAI;EAC5C,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAA;IAAA,OAASJ,cAAc,CAACK,MAAM,EAAEF,mBAAmB,CAAC;EAAA;EACrE,IAAMG,WAAW,GAAGR,oBAAoB,CAACG,SAAS,EAAEG,WAAW,CAAC;EAEhE,OAAO;IAAEE,WAAW,EAAXA,WAAW;IAAEC,MAAM,EAAER,MAAM,CAACO,WAAW;EAAE,CAAC;AACrD,CAAC;AAED,eAAeJ,cAAc"}