mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 10:36:14 +08:00
refactor(network): fix rxjs imports
This commit is contained in:
parent
8b1bb3ba17
commit
5387bc985a
@ -1,8 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaProperty, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaProperty,
|
||||
Plugin,
|
||||
CordovaCheck,
|
||||
IonicNativePlugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/merge';
|
||||
|
||||
import { merge } from 'rxjs/observable/merge';
|
||||
|
||||
declare const navigator: any;
|
||||
|
||||
@ -57,20 +62,17 @@ declare const navigator: any;
|
||||
})
|
||||
@Injectable()
|
||||
export class Network extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Connection type
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
type: string;
|
||||
@CordovaProperty type: string;
|
||||
|
||||
/**
|
||||
* Downlink Max Speed
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
downlinkMax: string;
|
||||
@CordovaProperty downlinkMax: string;
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection changes
|
||||
@ -78,7 +80,7 @@ export class Network extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaCheck()
|
||||
onchange(): Observable<any> {
|
||||
return Observable.merge(this.onConnect(), this.onDisconnect());
|
||||
return merge(this.onConnect(), this.onDisconnect());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +91,9 @@ export class Network extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'offline'
|
||||
})
|
||||
onDisconnect(): Observable<any> { return; }
|
||||
onDisconnect(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when the device goes online
|
||||
@ -99,6 +103,7 @@ export class Network extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'online'
|
||||
})
|
||||
onConnect(): Observable<any> { return; }
|
||||
|
||||
onConnect(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user