New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

is-offline

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

is-offline - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

11

dist/is-offline.es.js

@@ -1,5 +0,1 @@

function check() {
return Promise.resolve(!navigator.onLine);
}
function listen(evts, func, toAdd) {

@@ -12,2 +8,6 @@ var fn = window[(toAdd ? 'add' : 'remove') + 'EventListener'];

function check() {
return Promise.resolve(!navigator.onLine);
}
function watch(cb) {

@@ -22,3 +22,2 @@ var fn = function (_) { return check().then(cb); };

export { watch };
export default check;
export { check, watch };

@@ -5,6 +5,2 @@ 'use strict';

function check() {
return Promise.resolve(!navigator.onLine);
}
function listen(evts, func, toAdd) {

@@ -17,2 +13,6 @@ var fn = window[(toAdd ? 'add' : 'remove') + 'EventListener'];

function check() {
return Promise.resolve(!navigator.onLine);
}
function watch(cb) {

@@ -27,3 +27,3 @@ var fn = function (_) { return check().then(cb); };

exports.check = check;
exports.watch = watch;
exports['default'] = check;

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e["is-offline"]={})}(this,function(e){"use strict";function n(){return Promise.resolve(!navigator.onLine)}e.watch=function(e){var t=function(e,n,t){var o=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(e){o(e,n)})}.bind(null,"online offline",function(t){return n().then(e)});return t(!0),function(e){t(!1)}},e.default=n,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e["is-offline"]={})}(this,function(e){"use strict";function n(){return Promise.resolve(!navigator.onLine)}e.check=n,e.watch=function(e){var t=function(e,n,t){var o=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(e){o(e,n)})}.bind(null,"online offline",function(t){return n().then(e)});return t(!0),function(e){t(!1)}},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "is-offline",
"version": "2.0.0",
"description": "A tiny (279B) library to detect `offline` status & respond to changes in the browser.",
"version": "2.1.0",
"description": "A tiny (276B) library to detect `offline` status & respond to changes in the browser.",
"repository": "lukeed/is-offline",

@@ -6,0 +6,0 @@ "umd:main": "dist/is-offline.min.js",

# is-offline [![Build Status](https://travis-ci.org/lukeed/is-offline.svg?branch=master)](https://travis-ci.org/lukeed/is-offline)
> A tiny (279B) library to detect `offline` status & respond to changes in the browser.
> A tiny (276B) library to detect `offline` status & respond to changes in the browser.

@@ -24,3 +24,3 @@ This module exposes three module definitions:

```js
import isOffline from 'is-offline';
import { check, watch } from 'is-offline';

@@ -30,6 +30,6 @@ let foobar = bool => console.log('Am I offline?', bool);

// Check if currently offline
isOffline().then(foobar);
check().then(foobar);
// Setup a "watcher" to respond to all online/offline changes
let unwatch = isOffline.watch(foobar);
let unwatch = watch(foobar);

@@ -36,0 +36,0 @@ // The "watcher" will be active until it's deactivated

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