mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-02 19:04:15 -05:00
23 lines
571 B
Rust
23 lines
571 B
Rust
use crate::utils::use_derive_signal;
|
|
use leptos::*;
|
|
|
|
use_derive_signal!(
|
|
/// Reactive `ToString::to_string()`.
|
|
///
|
|
/// ## Usage
|
|
///
|
|
/// ```
|
|
/// # use leptos::*;
|
|
/// # use leptos_use::use_to_string;
|
|
/// #
|
|
/// # #[component]
|
|
/// # fn Demo(cx: Scope) -> impl IntoView {
|
|
/// let (number, set_number) = create_signal(cx, 3.14_f64);
|
|
/// let str = use_to_string::<_, f64>(cx, number);
|
|
/// #
|
|
/// # view! { cx, }
|
|
/// # }
|
|
/// ```
|
|
use_to_string<T, T: ToString + 'static> -> String
|
|
|value| value.to_string()
|
|
);
|