Fix effect stack issue

This commit is contained in:
Jonathan Kelley committed 2024-01-15 20:45:59 -08:00
1 parent a32ae8b112
commit bb750f5336
6 files changed
+38 -31

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
use dioxus_core::prelude::{consume_context, provide_context, push_future, use_hook};
use dioxus_core::prelude::{consume_context, provide_context, spawn, use_hook};
use dioxus_core::Task;
use dioxus_signals::{CopyValue, Signal};
pub use futures_channel::mpsc::{UnboundedReceiver, UnboundedSender};
@@ -83,7 +83,7 @@ where
// this might not be the best API
if *coroutine.needs_regen.read() {
let (tx, rx) = futures_channel::mpsc::unbounded();
let task = push_future(init(rx)).unwrap();
let task = spawn(init(rx));
coroutine.tx.set(Some(tx));
coroutine.task.set(Some(task));
coroutine.needs_regen.set_untracked(false);