Function ambient_element::use_module_message
source · pub fn use_module_message<T: ModuleMessage>(
hooks: &mut Hooks<'_>,
func: impl Fn(&mut World, MessageContext, &T) + Sync + Send + 'static
)
Expand description
Register a function to be called when a ModuleMessage is received.
The subscription will be automatically cancelled when this Element is unmounted.