fix Suspense to use the old, Effect-like scheduling after fixing RenderEffect

This commit is contained in:
Greg Johnston 2024-09-11 22:02:04 -04:00
parent 20db2094a0
commit 49aa5179af

View file

@ -13,7 +13,7 @@ use reactive_graph::{
effect::RenderEffect, effect::RenderEffect,
owner::{provide_context, use_context, Owner}, owner::{provide_context, use_context, Owner},
signal::ArcRwSignal, signal::ArcRwSignal,
traits::{Get, Read, Track, With}, traits::{Dispose, Get, Read, Track, With},
}; };
use slotmap::{DefaultKey, SlotMap}; use slotmap::{DefaultKey, SlotMap};
use tachys::{ use tachys::{
@ -277,7 +277,7 @@ where
futures::channel::oneshot::channel::<()>(); futures::channel::oneshot::channel::<()>();
let mut tasks_tx = Some(tasks_tx); let mut tasks_tx = Some(tasks_tx);
let eff = reactive_graph::effect::RenderEffect::new_isomorphic({ let eff = reactive_graph::effect::Effect::new_isomorphic({
move |_| { move |_| {
tasks.track(); tasks.track();
if tasks.read().is_empty() { if tasks.read().is_empty() {
@ -337,7 +337,7 @@ where
} }
children = children => { children = children => {
// clean up the (now useless) effect // clean up the (now useless) effect
drop(eff); eff.dispose();
Some(OwnedView::new_with_owner(children, owner)) Some(OwnedView::new_with_owner(children, owner))
} }