use leptos::*; use leptos_use::use_throttle_fn; use leptos_use::utils::demo_or_body; #[component] fn Demo(cx: Scope) -> impl IntoView { let (click_count, set_click_count) = create_signal(cx, 0); let (throttled_count, set_throttled_count) = create_signal(cx, 0); let mut throttled_fn = use_throttle_fn(move || set_throttled_count(throttled_count() + 1), 1000.0); view! { cx,
"Button clicked: " { click_count }
"Event handler called: " { throttled_count }
} } fn main() { _ = console_log::init_with_level(log::Level::Debug); console_error_panic_hook::set_once(); mount_to(demo_or_body(), |cx| { view! { cx,