Function futures_signals::signal::option

source ·
pub fn option<S>(value: Option<S>) -> OptionSignal<S>where
    S: Signal,
Expand description

Converts an Option<Signal<A>> into a Signal<Option<A>>.

This is mostly useful with SignalExt::switch or SignalExt::flatten.

If the value is None then it behaves like always, it just returns None.

If the value is Some(signal) then it will return the result of the signal, except wrapped in Some.