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