react-native-event-listeners icon indicating copy to clipboard operation
react-native-event-listeners copied to clipboard

removeAllListeners or removeEventListener doesn't change the count

Open mjhassan opened this issue 4 years ago • 2 comments

Thank you for this awesome module.

Whenever I perform removeEventListener or removeAllListeners after registering a listener it does remove from ref array but count property remains unchanged. Why is that?

In addition to that, if I emit an event after removing the listener it still invokes the handler. Anything I'm missing here?

mjhassan avatar May 31 '20 08:05 mjhassan

count should not be removed, it should always increase, it is the handle returned to caller, if it's changed, event1 register can unregister event2.

JunWangMaster avatar Aug 26 '20 06:08 JunWangMaster

is it joke?)) how we can remove handler?

tegozen avatar Jul 14 '22 13:07 tegozen