aevyrie / bevy_eventlistener

Event listening, bubbling, and callbacks
Apache License 2.0
178 stars 27 forks source link

Implement `Clone` for `On` #27

Closed alice-i-cecile closed 7 months ago

alice-i-cecile commented 7 months ago

The motivation is similar to #24: I'd like to have a reusable set of event handlers that I can instantiate.

aevyrie commented 7 months ago

I'm not sure if that is actually desirable. Callbacks contain boxed systems, and cloning them might result in them sharing state. Would need to make sure that is not the case. For now this is already possible - you can call constructors that spit out new event listeners.