feat: allow 'static futures to be spawned from handlers
This commit is contained in:
1 parent
d0fb05385a
commit
9ebafc46bb
5 files changed
+38
-9
No files matched your search
+8
-1
@@ -6,6 +6,13 @@ fn main() {
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(rsx! {
|
||||
button { "hello, desktop!" }
|
||||
button {
|
||||
onclick: |e| async move {
|
||||
println!("hello, desktop!");
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
println!("goodbye, desktop!");
|
||||
},
|
||||
"hello, desktop!"
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user