Merge pull request #1710 from Exotik850/cx-spawn-poll

Make cx.spawn poll the task before returning `TaskId`
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-01-04 10:07:22 -08:00
commit 1d289ff282
3 files changed
+20 -24

No files matched your search

+1 -7
View File
@@ -27,13 +27,7 @@ fn app(cx: Scope) -> Element {
button {
onclick: move |_| {
let dom = VirtualDom::new_with_props(compose, ComposeProps {
app_tx: tx.clone()
});
// this returns a weak reference to the other window
// Be careful not to keep a strong reference to the other window or it will never be dropped
// and the window will never close.
let dom = VirtualDom::new_with_props(compose, ComposeProps { app_tx: tx.clone() });
window.new_window(dom, Default::default());
},
"Click to compose a new email"