bind_state_init

Function bind_state_init 

Source
pub fn bind_state_init<T>(
    child: impl IntoUiNode,
    source: impl Fn() -> Var<T> + Send + 'static,
    state: impl IntoVar<T>,
) -> UiNode
where T: VarValue,
Expand description

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

On init the state closure is called to provide a variable, the 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.