feat: use future fully figured out
This commit is contained in:
1 parent
86729d929d
commit
9211e1fc78
7 files changed
+481
-348
No files matched your search
+2
-2
@@ -12,8 +12,8 @@ fn main() {
|
||||
fn app(cx: Scope) -> Element {
|
||||
let (count, set_count) = use_state(&cx, || 0);
|
||||
|
||||
use_future(&cx, move || {
|
||||
let set_count = set_count.to_owned();
|
||||
use_future(&cx, (), move |_| {
|
||||
let set_count = set_count.clone();
|
||||
async move {
|
||||
loop {
|
||||
tokio::time::sleep(Duration::from_millis(1000)).await;
|
||||
|
||||
Reference in new issue
Block a user