DEV Community

Keep working Offline with Javascript

Junior Oliveira on May 11, 2017

Note: It was originally wrote in Portuguese and translated by Google Let’s use as an example a system of messages exchange, where each message t...
Collapse
 
akshatbhargava123 profile image
Akshat

There's navigator.isOnline then why do we need it?

Collapse
 
arojunior profile image
Junior Oliveira

Hi! Thank you for your feedback. Actually, is just a Boolean and the correct property is "onLine" from navigator.

We need it because as I said before, it's just a Boolean to tell you when is online/offline... But how do you keep the failed request to send again when it came from offline to online?

The real meaning of this library is about do not lose requests.

Collapse
 
akshatbhargava123 profile image
Akshat

Ohhh okay, I get the point now. Thank you so much!