Use futures_util mutex instead of flume for sending flush lock wakeups

This commit is contained in:
Jonathan Kelley committed 2024-02-02 13:09:26 -08:00
1 parent 38bdab880d
commit 8f70a84c70
14 files changed
+100 -43

No files matched your search

+3 -6
View File
@@ -21,10 +21,7 @@ fn app() -> Element {
if count() > 30 {
return rsx! {
h1 { "Count is too high!" }
button {
onclick: move |_| count.set(0),
"Press to reset"
}
button { onclick: move |_| count.set(0), "Press to reset" }
};
}
@@ -38,8 +35,8 @@ fn app() -> Element {
}
});
// use_resource will spawn a future that resolves to a value - essentially an async memo
let _slow_count = use_async_memo(move || async move {
// use_resource will spawn a future that resolves to a value
let _slow_count = use_resource(move || async move {
tokio::time::sleep(Duration::from_millis(200)).await;
count() * 2
});