pub fn use_effect<D, R>(
    hooks: &mut Hooks<'_>,
    dependencies: D,
    run: impl FnOnce(&mut World, &D) -> R + Sync + Send
)
where D: PartialEq + Debug + Sync + Send + 'static, R: FnOnce(&mut World) + Sync + Send + 'static,
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.