Closed mebibou closed 7 years ago
Hi thanks for feedback
I didn't do because I figured out that channel.subscribe()
adds a new subscription, because i wanted to manage multiple subscription at same event.
If I call delete me.channels[eventname]
I will not allow such behaviour anymore.
I'll check the `cordova/channel' features
oh yes correct that's not the best idea. I am trying to do:
var func = function(event) {
console.log(event);
window.broadcaster.removeEventListener('test', func);
};
window.broadcaster.addEventListener('test', func);
to do a "one-off" kind of event listener. Maybe you have a better way to do this
i've released version 2.2.0
with fix.
Please, if possible, test it and let me know
Maybe it is not a good idea
window.broadcaster._channels = {};
Maybe it is not a good idea
window.broadcaster._channels = {};
It is bit drastic solution, but works. I implemented channelDelete
for selective removal but window.broadcaster._channels = {};
is like disable plugin
When I call successively
addEventListener
,removeEventListener
andaddEventListener
again, it does not subscribe using the new function passed in. I think it would be more proper to remove the key from the list of events so that it does register a new function.It would basically mean adding
delete me._channels[eventname]
here