-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fixes #18740, added the missing documentation for B parameter on Trigger. #18914
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
base: main
Are you sure you want to change the base?
Conversation
/// See [Trigger::propagate] for more information. It also provides a [Bundle] type representing a set of | ||
/// components associated with the triggered event. This would be useful to access the components or data | ||
/// that are related to the event. |
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.
Part of the confusion I was having with the B
parameter is that it doesn't seem to filter its contained components by default. Instead, I believe there is some extra step needed when defining the observer such that it can actually be used. I think pointing users to that method(s) and explaining how to use it could be a bit more useful.
/// See [Trigger::propagate] for more information. It also provides a [Bundle] type representing a set of | ||
/// components associated with the triggered event. This would be useful to access the components or data | ||
/// that are related to the event. |
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.
We should probably also mention how this bundle parameter will filter out entities that don't contain all components in the bundle (it could be the other way around, I forget haha)
/// A type that encapsulates information about a triggered [Event] during a specific [Observer] run. It includes | ||
/// the [Event] data, the corresponding [Entity] that triggered it, and details about event propagation. |
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.
Two minor nitpicks:
- The links should probably continue to use the backticks to indicate to the user that these are in fact traits/types
- Normally we recommend an empty line after the first sentence/summary
Objective
B
parameter onTrigger
#18740Solution
Testing