mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-03-12 09:02:54 -04:00
23 lines
488 B
Rust
23 lines
488 B
Rust
use leptos::*;
|
|
use leptos_use::docs::demo_or_body;
|
|
use leptos_use::{use_interval, UseIntervalReturn};
|
|
|
|
#[component]
|
|
fn Demo() -> impl IntoView {
|
|
let UseIntervalReturn { counter, .. } = use_interval(200);
|
|
|
|
view! {
|
|
<div>
|
|
<p>"Interval fired: " {counter}</p>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
_ = console_log::init_with_level(log::Level::Debug);
|
|
console_error_panic_hook::set_once();
|
|
|
|
mount_to(demo_or_body(), || {
|
|
view! { <Demo/> }
|
|
})
|
|
}
|