leptos-use 0.15.7

Collection of essential Leptos utilities inspired by React-Use / VueUse / SolidJS-USE
Documentation
use leptos::prelude::*;
use leptos::reactive::wrappers::read::Signal;

/// Reactive `NOT` condition.
///
/// ## Demo
///
/// [Link to Demo](https://github.com/Synphonyte/leptos-use/tree/main/examples/use_not)
///
/// ## Usage
///
/// ```
/// # use leptos::prelude::*;
/// # use leptos_use::math::use_not;
/// #
/// # #[component]
/// # fn Demo() -> impl IntoView {
/// let (a, set_a) = signal(true);
///
/// let not_a = use_not(a);
/// #
/// # view! { }
/// # }
/// ```
///
/// See also
///
/// - [`use_and`]
/// - [`use_or`]
///
// #[doc(cfg(feature = "math"))]
pub fn use_not<S>(a: S) -> Signal<bool>
where
    S: Into<Signal<bool>>,
{
    let a = a.into();
    Signal::derive(move || !a.get())
}