mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
fix event listener
This commit is contained in:
parent
22aae7422e
commit
55a7f1f377
@ -704,8 +704,9 @@ export class GoogleMapsPolyline {
|
|||||||
addEventListener(event: any): Observable<any> {
|
addEventListener(event: any): Observable<any> {
|
||||||
return new Observable(
|
return new Observable(
|
||||||
(observer) => {
|
(observer) => {
|
||||||
this._objectInstance.addEventListener(event, observer.next);
|
let cb = data => observer.next(data);
|
||||||
return () => this._objectInstance.removeEventListener(event, observer.next);
|
this._objectInstance.addEventListener(event, cb);
|
||||||
|
return () => this._objectInstance.removeEventListener(event, cb);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -787,8 +788,9 @@ export class GoogleMapsPolygon {
|
|||||||
addEventListener(event: any): Observable<any> {
|
addEventListener(event: any): Observable<any> {
|
||||||
return new Observable(
|
return new Observable(
|
||||||
(observer) => {
|
(observer) => {
|
||||||
this._objectInstance.addEventListener(event, observer.next);
|
let cb = data => observer.next(data);
|
||||||
return () => this._objectInstance.removeEventListener(event, observer.next);
|
this._objectInstance.addEventListener(event, cb);
|
||||||
|
return () => this._objectInstance.removeEventListener(event, cb);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user