angular-connectivity
v1.0.2
Published
Subscribe to a behavior subject that tracks Internet connectivity
Downloads
3
Readme
angular-connectivity
This library allows you to subscribe to a behavior subject that tracks Internet connectivity.
Usage Example
ngOnInit(): void {
// Keep track of network connectivity and update API if anything was only saved locally
this.subscriptions.push(this.connectivityService.isConnected$.subscribe(isConnected => {
this.isConnected = isConnected;
if (isConnected) {
// Do something
} else {
// Do something else
}
}));
}