fix(plugins): fix rxjs 6 build errors

#2439
This commit is contained in:
Daniel
2018-04-05 21:44:19 +02:00
parent 48b0f16ed9
commit 3ced31ed2a
54 changed files with 580 additions and 393 deletions
+9 -8
View File
@@ -1,5 +1,5 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
declare const navigator: any;
@@ -82,19 +82,20 @@ export interface GyroscopeOptions {
})
@Injectable()
export class Gyroscope extends IonicNativePlugin {
/**
* Watching for gyroscope sensor changes
* @param {GyroscopeOptions} [options]
* @return {Observable<GyroscopeOrientation>} Returns an Observable that resolves GyroscopeOrientation
*/
watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
return new Observable<GyroscopeOrientation>(
(observer: any) => {
const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
return () => navigator.gyroscope.clearWatch(watchId);
}
);
return new Observable<GyroscopeOrientation>((observer: any) => {
const watchId = navigator.gyroscope.watch(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.gyroscope.clearWatch(watchId);
});
}
/**