zng_wgt::node

Function event_state4

source
pub fn event_state4<A0, A1, A2, A3, S0, S1, S2, S3, S>(
    child: impl UiNode,
    state: impl IntoVar<S>,
    default: S,
    event0: Event<A0>,
    default0: S0,
    on_event0: impl FnMut(&A0) -> Option<S0> + Send + 'static,
    event1: Event<A1>,
    default1: S1,
    on_event1: impl FnMut(&A1) -> Option<S1> + Send + 'static,
    event2: Event<A2>,
    default2: S2,
    on_event2: impl FnMut(&A2) -> Option<S2> + Send + 'static,
    event3: Event<A3>,
    default3: S3,
    on_event3: impl FnMut(&A3) -> Option<S3> + Send + 'static,
    merge: impl FnMut(S0, S1, S2, S3) -> Option<S> + Send + 'static,
) -> impl UiNode
where A0: EventArgs, A1: EventArgs, A2: EventArgs, A3: EventArgs, S0: VarValue, S1: VarValue, S2: VarValue, S3: VarValue, S: VarValue,
Expand description

Helper for declaring state properties that depend on four other event states.

When the event# is received on_event# is called, if it provides a new value merge is called, if merge provides a new value the state variable is set.