feat: allow 'static futures to be spawned from handlers

This commit is contained in:
Jonathan Kelley committed 2023-02-06 00:54:08 -08:00
1 parent d0fb05385a
commit 9ebafc46bb
5 files changed
+38 -9

No files matched your search

+8 -1
View File
@@ -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!"
}
})
}