瀏覽代碼

Fix use_future always spawning a new task

Evan Almloff 1 年之前
父節點
當前提交
bfc8240438
共有 1 個文件被更改,包括 3 次插入0 次删除
  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