-
Notifications
You must be signed in to change notification settings - Fork 238
feat: add support for unregistering event handlers #283
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
feat: add support for unregistering event handlers #283
Conversation
Refactor callback management to use `Map` so that we can unregister handlers without changing the current behavior. Co-authored-by: Cassidy Williams <cassidy@netlify.com>
Deploy Success! Built with commit 61bd509 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use a Set
? Should do the same right?
@mraerino no real reason — we were thinking of key/val when we walked through solutions, and I didn't actually realize that Set had |
@jlengstorf, I added some tests and allowed doing Also handled a case where calling If we're all good with the changes I think this is ready to merge. |
thanks for adding those tests, @erezrokah! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me
Refactor callback management to use
Map
so that we can unregisterhandlers without changing the current behavior.