mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-26 22:20:19 +00:00
22 lines
429 B
Rust
22 lines
429 B
Rust
use dioxus::prelude::*;
|
|
use dioxus_signals::use_signal;
|
|
|
|
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;
|
|
println!("current: {count}");
|
|
}
|
|
});
|
|
|
|
rsx! {
|
|
div { "High-Five counter: {count}" }
|
|
}
|
|
}
|