mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-08 21:33:09 -05:00
# Conflicts: # CHANGELOG.md # Cargo.toml # src/is_err.rs # src/is_none.rs # src/is_ok.rs # src/is_some.rs # src/storage/use_local_storage.rs # src/storage/use_session_storage.rs # src/storage/use_storage.rs # src/use_broadcast_channel.rs # src/use_cookie.rs # src/use_device_pixel_ratio.rs # src/use_event_source.rs # src/use_to_string.rs # src/use_websocket.rs # src/utils/codecs/string/from_to_string.rs # src/utils/codecs/string/json.rs # src/utils/codecs/string/prost.rs
22 lines
531 B
Rust
22 lines
531 B
Rust
use leptos::prelude::*;
|
|
|
|
crate::use_derive_signal!(
|
|
/// Reactive `ToString::to_string()`.
|
|
///
|
|
/// ## Usage
|
|
///
|
|
/// ```
|
|
/// # use leptos::prelude::*;
|
|
/// # use leptos_use::use_to_string;
|
|
/// #
|
|
/// # #[component]
|
|
/// # fn Demo() -> impl IntoView {
|
|
/// let (number, set_number) = signal(3.14_f64);
|
|
/// let str = use_to_string::<_, f64>(number);
|
|
/// #
|
|
/// # view! { }
|
|
/// # }
|
|
/// ```
|
|
use_to_string<T, T: ToString + 'static> -> String
|
|
|value| value.to_string()
|
|
);
|