mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
refactor(three-dee-touch): use CordovaFunctionOverride decorator (#2028)
This commit is contained in:
parent
9a5211001f
commit
7c2a761078
@ -1,10 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, CordovaFunctionOverride, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
|
||||||
declare var window: any;
|
|
||||||
|
|
||||||
export interface ThreeDeeTouchQuickAction {
|
export interface ThreeDeeTouchQuickAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,16 +162,8 @@ export class ThreeDeeTouch extends IonicNativePlugin {
|
|||||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||||
*/
|
*/
|
||||||
onHomeIconPressed(): Observable<any> {
|
@CordovaFunctionOverride()
|
||||||
return new Observable(observer => {
|
onHomeIconPressed(): Observable<any> { return; }
|
||||||
if (window.ThreeDeeTouch) {
|
|
||||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
|
||||||
} else {
|
|
||||||
observer.error('3dTouch plugin is not available.');
|
|
||||||
observer.complete();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable Link Preview.
|
* Enable Link Preview.
|
||||||
|
Loading…
Reference in New Issue
Block a user