-
-
Notifications
You must be signed in to change notification settings - Fork 139
Allow events to be replaced #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added test for checking that a handler was added
Hi, I was having a similar issue as described in #150 yesterday. I just wanted to say that I have tested the code from this PR and it indeed solves the issue in my case.
Thanks ! 😄
Glad I could help @FloChehab...my issue became with using hooks, where the callback function that got called was a number of renders ago. My solution ended up using useCallback
to keep a memoized reference
korommatyi
commented
Aug 29, 2019
Can some of the maintainers please take a look? We are facing the same issue, would be nice to be able to update event handlers.
@gonzofish thanks for this PR, and my apologies it took so long to get it looked at :)
Addresses #150
addEventHandler
removeEventHandler
syncEventHandlers
that will replace a handler if it is not the already-stored handler