use_abs
Reactive abs()
.
Demo
Usage
use leptos::prelude::*;
use leptos_use::math::use_abs;
#[component]
fn Demo() -> impl IntoView {
let (value, set_value) = signal(-32.25);
let result: Signal<f64> = use_abs(value); // 32.25
assert_eq!(result.get(), 32.25);
view! { }
}
Feature
This function is only available if the crate feature
math
is enabled