Leptos-Use Guide

is_err

Reactive Result::is_err().

Usage

use leptos::prelude::*;
use leptos_use::is_err;

#[component]
fn Demo() -> impl IntoView {
let (example, set_example) = signal(
    if js_sys::Math::random() < 0.5 { Ok("Example") } else { Err(()) }
);

let is_error = is_err(example);

view! { }
}

Feature

This function is only available if the crate feature is_err is enabled

Source

SourceDocs