@hooks/network-status
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -7,5 +7,5 @@ "use strict"; | ||
function useNetworkStatus() { | ||
var _a, _b; | ||
var _a; | ||
const [status, setStatus] = react_1.useState({ | ||
online: typeof window !== 'undefined' ? (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.navigator) === null || _b === void 0 ? void 0 : _b.onLine : undefined, | ||
online: typeof window !== 'undefined' ? (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.onLine : undefined, | ||
}); | ||
@@ -15,4 +15,4 @@ react_1.useEffect(() => { | ||
setStatus(prevStatus => { | ||
var _a, _b; | ||
return (Object.assign(Object.assign({}, prevStatus), { online: typeof window !== 'undefined' ? (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.navigator) === null || _b === void 0 ? void 0 : _b.onLine : undefined })); | ||
var _a; | ||
return (Object.assign(Object.assign({}, prevStatus), { online: typeof window !== 'undefined' ? (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.onLine : undefined })); | ||
}); | ||
@@ -19,0 +19,0 @@ }; |
@@ -5,5 +5,5 @@ import { useState, useEffect } from 'react'; | ||
export default function useNetworkStatus() { | ||
var _a, _b; | ||
var _a; | ||
const [status, setStatus] = useState({ | ||
online: typeof window !== 'undefined' ? (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.navigator) === null || _b === void 0 ? void 0 : _b.onLine : undefined, | ||
online: typeof window !== 'undefined' ? (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.onLine : undefined, | ||
}); | ||
@@ -13,4 +13,4 @@ useEffect(() => { | ||
setStatus(prevStatus => { | ||
var _a, _b; | ||
return (Object.assign(Object.assign({}, prevStatus), { online: typeof window !== 'undefined' ? (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.navigator) === null || _b === void 0 ? void 0 : _b.onLine : undefined })); | ||
var _a; | ||
return (Object.assign(Object.assign({}, prevStatus), { online: typeof window !== 'undefined' ? (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.onLine : undefined })); | ||
}); | ||
@@ -17,0 +17,0 @@ }; |
@@ -11,7 +11,7 @@ { | ||
], | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"types": "index.d.ts", | ||
"typings": "index.d.ts", | ||
"types": "typings/index.d.ts", | ||
"typings": "typings/index.d.ts", | ||
"files": [ | ||
@@ -38,3 +38,3 @@ "cjs", | ||
}, | ||
"gitHead": "596ed676b9f26622d038977530015abfb9fd5505" | ||
"gitHead": "14e6a3da5d5d3f295fb5df5e72201a0f9d13ed10" | ||
} |
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
4857