angular-connectivity
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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
            }
        }));
    }

Readme

Keywords

none

Package Sidebar

Install

npm i angular-connectivity

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

14.4 kB

Total Files

15

Last publish

Collaborators

  • paulgilchrist