Fix restarting coroutines (#3005)

* Fix restarting coroutines

* Fix popup example
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-10-03 18:48:26 -05:00
1 parent eeb8428847
commit 9ffd4b816b
3 files changed
+20 -35

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ fn app() -> Element {
let mut emails_sent = use_signal(|| Vec::new() as Vec<String>);
// Wait for responses to the compose channel, and then push them to the emails_sent signal.
let handle = use_coroutine(|mut rx: UnboundedReceiver<String>| async move {
let handle = use_coroutine(move |mut rx: UnboundedReceiver<String>| async move {
use futures_util::StreamExt;
while let Some(message) = rx.next().await {
emails_sent.write().push(message);