Closed Prabuganesan closed 3 years ago
Thanks.. I'm using 'ionic-native/broadcaster' plugin in ionic 3. 'removeEventListener' method not available. Can u please help me....
Keep in mind that ionic-native/broadcaster
wraps original methods.
In particular, in the ionic-native/broadcaster
, the addEventListener(eventName: string): Observable<any>
return an Observable and the removeEventListener
is implicit in Observable unsubscription than you can use that to stop broadcaster.
let subscription = this.broadcaster.addEventListener('eventName')
.subscribe((event) => console.log(event));
subscription.unsubscribe();
Thanks for your clarification..
I'm not sure what do you mean for stop broadcaster.
However the plugin provide a
removeEventListener
to unsubscribe (and eventually remove) subscription