fix signals in futures

This commit is contained in:
Evan Almloff committed 2023-08-04 17:25:40 -07:00
1 parent a6f611eccf
commit b3fbbba711
2 files changed
+12 -6

No files matched your search

+6 -6
View File
@@ -33,12 +33,12 @@ struct ChildProps {
fn Child(cx: Scope<ChildProps>) -> Element {
let count = cx.props.count;
// use_future!(cx, || async move {
// loop {
// tokio::time::sleep(std::time::Duration::from_secs(count.value())).await;
// *count.write() += 1;
// }
// });
use_future!(cx, || async move {
loop {
tokio::time::sleep(std::time::Duration::from_secs(count.value())).await;
*count.write() += 1;
}
});
render! {
div {