Function ambient_api::prelude::ambient_element::use_effect
source · pub fn use_effect<D, R>(
hooks: &mut Hooks<'_>,
dependencies: D,
run: impl FnOnce(&mut World, &D) -> R + Sync + Send
)
Expand description
Run a function for its side effects each time a dependency changes.
The function should return another function; that function will be called when the Element is unmounted.