-
Notifications
You must be signed in to change notification settings - Fork 36
feat: add support for abort controllers to event handlers #1151
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
Merged
+120
−60
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Michael Beemer <[email protected]>
lukas-reining
approved these changes
Feb 19, 2025
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.
Nice change!
I really like how this makes it unnecessary to keep a reference to the handler!
I think the react example speaks for itself.
This was referenced Feb 26, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 10, 2025
🤖 I have created a release *beep* *boop* --- ## [1.8.0](core-v1.7.2...core-v1.8.0) (2025-04-10) ### ✨ New Features * add support for abort controllers to event handlers ([#1151](#1151)) ([6a22483](6a22483)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]>
lukas-reining
added a commit
that referenced
this pull request
Apr 11, 2025
🤖 I have created a release *beep* *boop* --- ## [1.18.0](server-sdk-v1.17.1...server-sdk-v1.18.0) (2025-04-11) ### ✨ New Features * add a top-level method for accessing providers ([#1152](#1152)) ([ae8fce8](ae8fce8)) * add support for abort controllers to event handlers ([#1151](#1151)) ([6a22483](6a22483)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]> Co-authored-by: Lukas Reining <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 14, 2025
🤖 I have created a release *beep* *boop* --- ## [1.5.0](web-sdk-v1.4.1...web-sdk-v1.5.0) (2025-04-11) ### ✨ New Features * add a top-level method for accessing providers ([#1152](#1152)) ([ae8fce8](ae8fce8)) * add support for abort controllers to event handlers ([#1151](#1151)) ([6a22483](6a22483)) ### 🐛 Bug Fixes * Typo in name of the function ([2c5b37c](2c5b37c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Lukas Reining <[email protected]> Co-authored-by: Todd Baert <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 14, 2025
🤖 I have created a release *beep* *boop* --- ## [1.0.0](react-sdk-v0.4.11...react-sdk-v1.0.0) (2025-04-14) ### ✨ New Features * add polyfill for react use hook ([#1157](#1157)) ([5afe61f](5afe61f)) * add support for abort controllers to event handlers ([#1151](#1151)) ([6a22483](6a22483)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
addHandler
API both globally and on the client.Notes
This change was inspired by this blog. It allows us to use abort controllers to easily unregister event handlers. I've checked MDN to confirm that we shouldn't have any compatibility issues.
Follow-up Tasks
We'll need to bump the min peer dependency versions when releasing to avoid issues.
How to test
There should be pretty good test coverage of this. Please let me know if you spot any gaps.