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