zng_wgt::node

Function bind_state

source
pub fn bind_state<T: VarValue>(
    child: impl UiNode,
    source: impl IntoVar<T>,
    state: impl IntoVar<T>,
) -> impl UiNode
Expand description

Helper for declaring state properties that are controlled by a variable.

On init the state variable is set to source and bound to it, you can use this to create state properties that map from a context variable or to create composite properties that merge other state properties.