Add support for custom events - #271
Open
freya022 wants to merge 17 commits into
Open
Conversation
Previously, all event types were known, and so we were able to group the handlers by what they were listening to However this required scanning the events present at runtime, which not only took some time, but also prevents using custom events The new approach instead computes the handlers eligible for a certain event when it is first fired, this performs slightly better and works for any event type and simplifies the logic for adding/removing listeners
It is unnecessary
Would have caused a circular dependency when a user attempts to inject an EventDispatcher in an event listener class
It's an assumption in some places
Makes it easier to test and declutters the registry service
This reverts commit f68bdbc.
As the registry may reference classes that uses the dispatcher
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
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.
It is now allowed to make listeners of any type. (except
Any/Object)Users who wish to listen to custom events must have at least one
CustomEventRequirementsProvider,which must return the requirements for the provided event type.
Note: This API is considered experimental and requires an opt-in.