From 40ecc2bd7843a012dcdfab17158982372a8ba161 Mon Sep 17 00:00:00 2001 From: Giovanni <88086644+Giovanni-Tably@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:36:03 +0100 Subject: [PATCH] fix: dispose of `watch` effect normally --- leptos_reactive/src/runtime.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/leptos_reactive/src/runtime.rs b/leptos_reactive/src/runtime.rs index 600e512e9..9b5fc4364 100644 --- a/leptos_reactive/src/runtime.rs +++ b/leptos_reactive/src/runtime.rs @@ -1175,11 +1175,7 @@ impl RuntimeId { ); (id, move || { - with_runtime(|runtime| { - runtime.nodes.borrow_mut().remove(id); - runtime.node_sources.borrow_mut().remove(id); - }) - .expect( + with_runtime(|runtime| runtime.dispose_node(id)).expect( "tried to stop a watch in a runtime that has been disposed", ); })