Prechádzať zdrojové kódy

Fix use_future always spawning a new task

Evan Almloff 1 rok pred
rodič
commit
bfc8240438
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  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