react-screentype-hook
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-screentype-hook"]=t(require("react")):e["react-screentype-hook"]=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o={largeDesktop:1440,desktop:992,tablet:768,mobile:320},i="MOBILE",a="TABLET",u="DESKTOP",c="LARGE_DESKTOP",d=function(e){return{isMobile:e===i,isTablet:e===a,isDesktop:e===u,isLargeDesktop:e===c}},f=function(e){return{isMobile:window.innerWidth<e.tablet,isTablet:window.innerWidth>=e.tablet&&window.innerWidth<e.desktop,isDesktop:window.innerWidth>=e.desktop&&window.innerWidth<e.largeDesktop,isLargeDesktop:window.innerWidth>=e.largeDesktop}};function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=Object(n.useState)(d(e)),r=l(t,2),s=r[0],p=r[1],b=function(e){return function(t){return t.matches&&p(d(e))}};return Object(n.useEffect)((function(){p(f(e));var t=matchMedia("(min-width: ".concat(e.largeDesktop,"px)")),r=matchMedia("(min-width: ".concat(e.desktop,"px) and (max-width: ").concat(e.largeDesktop-1,"px)")),n=matchMedia("(min-width: ".concat(e.tablet,"px) and (max-width: ").concat(e.desktop-1,"px)")),o=matchMedia("(max-width: ".concat(e.tablet,"px)"));return o.addListener(b(i)),n.addListener(b(a)),r.addListener(b(u)),t.addListener(b(c)),function(){o.removeListener(b(i)),n.removeListener(b(a)),r.removeListener(b(u)),t.removeListener(b(c))}}),[s]),s};r.d(t,"default",(function(){return p}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-screentype-hook"]=t(require("react")):e["react-screentype-hook"]=t(e.react)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o={largeDesktop:1440,desktop:992,tablet:768,mobile:320},i="MOBILE",a="TABLET",u="DESKTOP",c="LARGE_DESKTOP",d=function(e){return{isMobile:e===i,isTablet:e===a,isDesktop:e===u,isLargeDesktop:e===c}},f=function(e){return{isMobile:window.innerWidth<e.tablet,isTablet:window.innerWidth>=e.tablet&&window.innerWidth<e.desktop,isDesktop:window.innerWidth>=e.desktop&&window.innerWidth<e.largeDesktop,isLargeDesktop:window.innerWidth>=e.largeDesktop}};function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=Object(n.useState)(d(e)),r=l(t,2),s=r[0],p=r[1],b=function(e){return function(t){return t.matches&&p(d(e))}};return Object(n.useEffect)((function(){p(f(e));var t=matchMedia("(min-width: ".concat(e.largeDesktop,"px)")),r=matchMedia("(min-width: ".concat(e.desktop,"px) and (max-width: ").concat(e.largeDesktop-1,"px)")),n=matchMedia("(min-width: ".concat(e.tablet,"px) and (max-width: ").concat(e.desktop-1,"px)")),o=matchMedia("(max-width: ".concat(e.tablet,"px)"));return o.addListener(b(i)),n.addListener(b(a)),r.addListener(b(u)),t.addListener(b(c)),function(){o.removeListener(b(i)),n.removeListener(b(a)),r.removeListener(b(u)),t.removeListener(b(c))}}),[]),s};r.d(t,"default",(function(){return p}))}])})); |
{ | ||
"name": "react-screentype-hook", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "react-screentype-hook", |
@@ -49,3 +49,3 @@ import { useState, useEffect } from "react"; | ||
}; | ||
}, [screenType]); | ||
}, []); | ||
return screenType; | ||
@@ -52,0 +52,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27350