dioxus/examples/clock.rs
2024-01-20 00:11:55 -08:00

20 lines
355 B
Rust

use dioxus::prelude::*;
fn main() {
launch_desktop(app);
}
fn app() -> Element {
let mut count = use_signal(|| 0);
use_future(|| async move {
loop {
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
count += 1;
}
});
rsx! {
div { "High-Five counter: {count}" }
}
}