mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-07 23:03:19 +08:00
fix(in-app-browser): remove duplicated method (#4838)
This commit is contained in:
parent
c40a73407d
commit
3a64cd4bcd
@ -125,7 +125,8 @@ export type InAppBrowserEventType =
|
|||||||
| 'exit'
|
| 'exit'
|
||||||
| 'beforeload'
|
| 'beforeload'
|
||||||
| 'message'
|
| 'message'
|
||||||
| 'customscheme';
|
| 'customscheme'
|
||||||
|
| string
|
||||||
|
|
||||||
export interface InAppBrowserEvent extends Event {
|
export interface InAppBrowserEvent extends Event {
|
||||||
/** the event name */
|
/** the event name */
|
||||||
@ -245,19 +246,6 @@ export class InAppBrowserObject {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A method that allows you to listen to events happening in the browser.
|
|
||||||
*
|
|
||||||
* @param event {string} Name of the event
|
|
||||||
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
|
||||||
*/
|
|
||||||
@InstanceCheck()
|
|
||||||
on(event: string): Observable<InAppBrowserEvent> {
|
|
||||||
return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
|
|
||||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
|
||||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user