What problem does this solve or what need does it fill?
It could be useful to have multiple component hooks for a given Component.
A usecase would be to allow libraries to create component-hooks that won't be overriden by the user.
For example, you could imagine bevy_ecs wanting to update change detection ticks via component hooks, while still allowing the user to define their own component hooks.
PROS:
- increased flexibility
CONS:
- performance? we would have to store a Vec of hooks instead of just Option
- how to guarantee an ordering between the hooks?
What solution would you like?
Letting ComponentHooks store multiple hooks of a given type (on_add, on_remove, etc.) for a component.
What alternative(s) have you considered?
- Use observers? (not too familiar with them)
- do not allow multiple hooks
What problem does this solve or what need does it fill?
It could be useful to have multiple component hooks for a given Component.
A usecase would be to allow libraries to create component-hooks that won't be overriden by the user.
For example, you could imagine bevy_ecs wanting to update change detection ticks via component hooks, while still allowing the user to define their own component hooks.
PROS:
CONS:
What solution would you like?
Letting
ComponentHooksstore multiple hooks of a given type (on_add, on_remove, etc.) for a component.What alternative(s) have you considered?