use leptos::*;
use leptos_use::docs::{demo_or_body, Note};
use leptos_use::watch_throttled;
#[component]
fn Demo(cx: Scope) -> impl IntoView {
let (input, set_input) = create_signal(cx, "".to_string());
let (updated, set_updated) = create_signal(cx, 0);
let _ = watch_throttled(
cx,
move || input.get(),
move |_, _, _| {
set_updated.update(|x| *x += 1);
},
1000.0,
);
view! { cx,
"ms"
" is set to 1000ms for this demo."
"Input: " { input }
"Times Updated: " { updated }
} } fn main() { _ = console_log::init_with_level(log::Level::Debug); console_error_panic_hook::set_once(); mount_to(demo_or_body(), |cx| { view! { cx,