Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hooks/network-status

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hooks/network-status - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

8

cjs/index.js

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc