From 49aa5179af39c0e80548ac49bc9edd58a8af4770 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Wed, 11 Sep 2024 22:02:04 -0400 Subject: [PATCH] fix Suspense to use the old, Effect-like scheduling after fixing RenderEffect --- leptos/src/suspense_component.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leptos/src/suspense_component.rs b/leptos/src/suspense_component.rs index 2d3c113bd..adda40914 100644 --- a/leptos/src/suspense_component.rs +++ b/leptos/src/suspense_component.rs @@ -13,7 +13,7 @@ use reactive_graph::{ effect::RenderEffect, owner::{provide_context, use_context, Owner}, signal::ArcRwSignal, - traits::{Get, Read, Track, With}, + traits::{Dispose, Get, Read, Track, With}, }; use slotmap::{DefaultKey, SlotMap}; use tachys::{ @@ -277,7 +277,7 @@ where futures::channel::oneshot::channel::<()>(); let mut tasks_tx = Some(tasks_tx); - let eff = reactive_graph::effect::RenderEffect::new_isomorphic({ + let eff = reactive_graph::effect::Effect::new_isomorphic({ move |_| { tasks.track(); if tasks.read().is_empty() { @@ -337,7 +337,7 @@ where } children = children => { // clean up the (now useless) effect - drop(eff); + eff.dispose(); Some(OwnedView::new_with_owner(children, owner)) }