refactor(network): fix rxjs imports

This commit is contained in:
Daniel 2018-04-21 15:30:41 +02:00
parent 8b1bb3ba17
commit 5387bc985a

View File

@ -1,8 +1,13 @@
import { Injectable } from '@angular/core'; 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 { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge'; import { merge } from 'rxjs/observable/merge';
declare const navigator: any; declare const navigator: any;
@ -57,20 +62,17 @@ declare const navigator: any;
}) })
@Injectable() @Injectable()
export class Network extends IonicNativePlugin { export class Network extends IonicNativePlugin {
/** /**
* Connection type * Connection type
* @return {string} * @return {string}
*/ */
@CordovaProperty @CordovaProperty type: string;
type: string;
/** /**
* Downlink Max Speed * Downlink Max Speed
* @return {string} * @return {string}
*/ */
@CordovaProperty @CordovaProperty downlinkMax: string;
downlinkMax: string;
/** /**
* Returns an observable to watch connection changes * Returns an observable to watch connection changes
@ -78,7 +80,7 @@ export class Network extends IonicNativePlugin {
*/ */
@CordovaCheck() @CordovaCheck()
onchange(): Observable<any> { 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, eventObservable: true,
event: 'offline' event: 'offline'
}) })
onDisconnect(): Observable<any> { return; } onDisconnect(): Observable<any> {
return;
}
/** /**
* Get notified when the device goes online * Get notified when the device goes online
@ -99,6 +103,7 @@ export class Network extends IonicNativePlugin {
eventObservable: true, eventObservable: true,
event: 'online' event: 'online'
}) })
onConnect(): Observable<any> { return; } onConnect(): Observable<any> {
return;
}
} }