Skip to content

Commit

Permalink
fix(in-app-browser): remove duplicated method (#4838)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximBelov authored Oct 13, 2024
1 parent c40a734 commit 3a64cd4
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/@awesome-cordova-plugins/plugins/in-app-browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export type InAppBrowserEventType =
| 'exit'
| 'beforeload'
| 'message'
| 'customscheme';
| 'customscheme'
| string

export interface InAppBrowserEvent extends Event {
/** the event name */
Expand Down Expand Up @@ -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));
});
}
}

/**
Expand Down

0 comments on commit 3a64cd4

Please sign in to comment.