Browse Source

Fix use_future always spawning a new task

Evan Almloff 1 year ago
parent
commit
bfc8240438
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/hooks/src/usefuture.rs

+ 3 - 0
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