Socket
Socket
Sign inDemoInstall

ngx-fi-online

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-fi-online

navigator.onLine wrapper for ngx projects


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

NgxFiOnline

navigator.onLine wrapper

Installation

  • npm i ngx-fi-online --save

How to use

In a module

import { NgModule } from "@angular/core";
import { NgxFiOnlineModule } from "ngx-fi-online";

@NgModule({
  imports: [NgxFiOnlineModule], // for consumption within the scope of the module
  exports: [NgxFiOnlineModule] // if propagation is required
})
export class SomeModule {}

Where required

import { Inject } from "@angular/core";
import { OnlineDefinition, ONLINE_TOKEN } from "ngx-fi-online";

export class SomeClass {
  constructor(@Inject(ONLINE_TOKEN) private online: OnlineDefinition) {
    const isOnline = online.is();
  }
}

For testing

import { NgxFiOnlineModule } from "ngx-fi-online";
import { OnlineDefinition, ONLINE_TOKEN } from "ngx-fi-online";

describe('TestingTitle', () => {
  let online: OnlineDefinition;
  beforeEach(async(() => {
      TestBed.configureTestingModule({
        imports: [NgxFiOnlineModule]
      });

      online = TestBed.get(ONLINE_TOKEN);
    }));
  }));
}));

Keywords

FAQs

Package last updated on 07 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc