pub fn disposable_effect<K, F>(key: K, effect: F)Expand description
Runs effect after this call site enters the composition and again whenever key
changes, and runs the cleanup it returned before the next run and when the call site
leaves. Compose’s DisposableEffect.
ⓘ
disposable_effect(channel.clone(), move || {
let subscription = subscribe(&channel);
on_dispose(move || drop(subscription))
});