zng_wgt::node

Function presenter_opt

source
pub fn presenter_opt<D: VarValue>(
    data: impl IntoVar<Option<D>>,
    wgt_fn: impl IntoVar<WidgetFn<D>>,
) -> impl UiNode
Expand description

Node that presents data using wgt_fn if data is available, otherwise presents nil.

This behaves like presenter, but wgt_fn is not called if data is None.