Last active
October 4, 2019 11:47
-
-
Save nolimits4web/527ceddaf117325e8be3ee2e91f6bdca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = new Framework7(/*...*/); | |
if (app.online) { | |
console.log('online!'); | |
} | |
if (!app.online) { | |
console.log('offline!'); | |
} | |
app.on('online', () => { | |
console.log('connection established') | |
}); | |
app.on('offline', () => { | |
console.log('lost connection') | |
}); | |
// or with single event | |
app.on('connection', (isOnline) => { | |
if (isOnline) { | |
console.log('connection established') | |
} else { | |
console.log('lost connection') | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment