leptos_use

Function is_ok

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

Reactive Result::is_ok().

ยงUsage

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

let is_ok = is_ok(example);