Closed azanli closed 6 years ago
Nevermind again. I just noticed what I was doing wrong the whole time. The documented way works perfectly fine and listener.remove() should not be called if it wasn't subscribed in the first place. Sorry for the noise.
Includes a single function to remove all listeners attached to
NativeEmitter
. Also updates the sdk to reflect this change in the example subscribe/unsubscribe workflow.The reason I did this was because I had trouble following the docs to get the unsubscribe part to work. This method works and is a bit less wordy.