is_some
Reactive Option::is_some()
.
Usage
use leptos::prelude::*;
use leptos_use::is_some;
#[component]
fn Demo() -> impl IntoView {
let (example, set_example) = signal(
if js_sys::Math::random() < 0.5 { Some("Example") } else { None }
);
let not_empty = is_some::<_, &str>(example);
view! { }
}
Feature
This function is only available if the crate feature
is_some
is enabled