Properly implement wait_for_suspense
Wait_for_suspense now does not call flush_sync, making it appropriate for deferring effects on the server. Futures will still run on the server (as needed to progress suspense) but use_effect / and memo watchers will not run on the server
This commit is contained in:
11 files changed
+156
-86
No files matched your search
@@ -58,6 +58,9 @@ impl Task {
|
||||
Runtime::with(|rt| {
|
||||
// set the active flag, and then ping the scheduler to ensure the task gets queued
|
||||
let was_active = rt.tasks.borrow()[self.0].active.replace(true);
|
||||
if !was_active {
|
||||
_ = rt.sender.unbounded_send(SchedulerMsg::TaskNotified(*self));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user