chore: clean up clock

This commit is contained in:
Jonathan Kelley committed 2022-12-30 02:41:09 -05:00
1 parent daa5449b6b
commit ba20bc08b8
2 files changed
+3 -6

No files matched your search

+3 -4
View File
@@ -3,16 +3,15 @@
//! The example from the README.md.
use dioxus::prelude::*;
use futures_util::Future;
fn main() {
dioxus_desktop::launch(app);
}
fn app(cx: Scope) -> Element {
let mut count = use_ref(cx, || 0);
let count = use_ref(cx, || 0);
let mut ct = count.to_owned();
let ct = count.to_owned();
use_coroutine(cx, |_: UnboundedReceiver<()>| async move {
loop {
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
@@ -25,7 +24,7 @@ fn app(cx: Scope) -> Element {
}
});
let mut count = count.read();
let count = count.read();
cx.render(rsx! {
div { "High-Five counter: {count}" }
-2
View File
@@ -72,8 +72,6 @@ pub struct LocalTaskHandle {
impl ArcWake for LocalTaskHandle {
fn wake_by_ref(arc_self: &Arc<Self>) {
println!("waking task: {:?} {:p}", arc_self.id, arc_self);
arc_self
.tx
.unbounded_send(SchedulerMsg::TaskNotified(arc_self.id))