2018-12-18 16:58:06 +00:00
|
|
|
import * as webdetector from '../ts/index'
|
|
|
|
|
2018-12-19 16:17:25 +00:00
|
|
|
console.log('hi');
|
2018-12-18 16:58:06 +00:00
|
|
|
|
2018-12-19 16:17:25 +00:00
|
|
|
const run = async () => {
|
|
|
|
const testWebDetector = new webdetector.WebDetector({
|
|
|
|
checkOnlineUrl: 'https://pubapi.lossless.one'
|
|
|
|
});
|
|
|
|
const onlineResultBoolean = await testWebDetector.isOnline();
|
|
|
|
console.log('browser is online:')
|
|
|
|
console.log(onlineResultBoolean);
|
|
|
|
testWebDetector.startPeriodicChecks();
|
|
|
|
testWebDetector.onlineObservable.subscribe((state) => {
|
|
|
|
console.log(state);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
run();
|