Skip to content

Conversation

@DickyT
Copy link
Contributor

@DickyT DickyT commented Jan 24, 2016

Hi there,
I noticed that inside the addListener, if someone trying to listen to an event which is already listened before, which will cause RNTGlobalEventEmitter.addObserver(eventName); run one more time, which is unnecessary to register an native listener at NSNotificationCenter.

Whats more, I added removeListenderById method, because sometimes to deal with scope issues, you need to passing a closure / code block to the addListener, which makes removeListener harder. With removeListenderById, you only need to passing the event name and the reference ID, which can get from addListener.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling

@paramaggarwal
Copy link
Owner

Looks good @DickyT. Just two tiny comments, and we can merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants