Monday, 3 April 2017

Using Offline.js in Node

I'm having a hard time to make use of the Offline.js in NodeJS. I've used the Offline.js like the following but it always shows check() is undefined or any other methods.

import Offline from 'offline-js'

Offline.options = {
  checkOnLoad: true,
  checks: {
    xhr: {
      url: 'http://google.com'
    }
  }
}

Offline.check()

Offline.Offline.on('up', () => {
  alert('Up')
})

Offline.Offline.down('down', () => {
  alert('Down')
})



via Md Mazedul Islam Khan

No comments:

Post a Comment