From bfc8240438993b6533baac332ea870de18500d44 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 21 Jul 2023 11:52:41 -0700 Subject: [PATCH] Fix use_future always spawning a new task --- packages/hooks/src/usefuture.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/hooks/src/usefuture.rs b/packages/hooks/src/usefuture.rs index 4d90adbd4..4200f697b 100644 --- a/packages/hooks/src/usefuture.rs +++ b/packages/hooks/src/usefuture.rs @@ -52,6 +52,9 @@ where val.set(Some(fut.await)); task.take(); }))); + + // Mark that we don't need to regenerate + state.needs_regen.set(false); } state