mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
Merge branch 'master' into v5
This commit is contained in:
@@ -88,14 +88,12 @@ export class Gyroscope extends IonicNativePlugin {
|
||||
* @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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user