Skip to main content

derived_state_of

Function derived_state_of 

Source
pub fn derived_state_of<T: Clone + PartialEq + 'static>(
    calculation: impl Fn() -> T + 'static,
) -> DerivedState<T>
Expand description

A state computed from the states calculation reads.

ⓘ
let empty = remember(move || derived_state_of(move || tasks.with(Vec::is_empty)));
if empty.get() { Text("Nothing to do") }