leptos_use

Function is_some

Source
pub fn is_some<V, T>(value: V) -> Signal<bool>
where V: Into<MaybeSignal<Option<T>>>, T: 'static,
Expand description

Reactive Option::is_some().

ยงUsage

let (example, set_example) = create_signal(
    if js_sys::Math::random() < 0.5 { Some("Example") } else { None }
);

let not_empty = is_some(example);