2023-07-16 14:17:15 +01:00
|
|
|
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]
|
2023-07-27 18:06:36 +01:00
|
|
|
/// # fn Demo() -> impl IntoView {
|
|
|
|
/// let (number, set_number) = create_signal(3.14_f64);
|
|
|
|
/// let str = use_to_string::<_, f64>(number);
|
2023-07-16 14:17:15 +01:00
|
|
|
/// #
|
2023-07-27 18:06:36 +01:00
|
|
|
/// # view! { }
|
2023-07-16 14:17:15 +01:00
|
|
|
/// # }
|
|
|
|
/// ```
|
|
|
|
use_to_string<T, T: ToString + 'static> -> String
|
|
|
|
|value| value.to_string()
|
|
|
|
);
|