New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

angular-reachability

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-reachability

Ionic Network Reachability, it is used for `testing` network connection.

latest
Source
npmnpm
Version
0.0.22
Version published
Weekly downloads
4
100%
Maintainers
0
Weekly downloads
 
Created
Source

Ionic Network Reachability

Ionic Network Reachability, it is used for testing network connection.

Ionic Network Reachability

npm install angular-reachability --save

Usage

app.component.ts

import { IonicNetworkReachability } from 'angular-reachability';

export class AppComponent {

    constructor(private reachability: IonicNetworkReachability) {}

    async checkOnline() {
        try {
            const isOnline = await this.reachability.isReachable('url is optional');
            return isOnline;
        } catch(err) {
            
        }
    }

    monitoringOnlineEvents(url: string) {
        this.reachability.onConnect('url is optional').subscribe((value: boolean) => {
            console.log('online :)');
        });
    }

    monitoringOfflineEvents() {
        this.reachability.onDisconnect().subscribe(() => {
            console.log('offline :(')
        });
    }
}

Keywords

ionic

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts