Skip to content

baianat-experiments/connection-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

down.js

Detects when the user connection goes down

Usage

ES6

import Down from 'down.js';

const down = new Down();

CDN

  <script src="link/to/down.js"></script>
  <script>
    const down = new Down();
  </script>

API

const down = new Down();

this.isOnline = !this.$down.isDown;
this.$down.on('online', () => {
  this.isOnline = true;
});

this.$down.on('offline', () => {
  this.isOnline = false;
});

Compatability

This library requires a polyfill for fetch.

MIT

About

[WIP] strategy based user connection status detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published