Make cx.spawn() return an Option<TaskId>, returns None if finished immediately

This commit is contained in:
kidkool850@gmail.com committed 2023-12-11 16:01:40 -06:00
1 parent 695bf009d1
commit 69ca1fd8a7
8 files changed
+38 -37

No files matched your search

@@ -76,7 +76,7 @@ where
cx.remove_future(current);
}
state.task.set(Some(cx.push_future(async move {
state.task.set(cx.push_future(async move {
let data;
#[cfg(feature = "ssr")]
{
@@ -94,7 +94,7 @@ where
*value.borrow_mut() = Some(Box::new(data));
schedule_update();
})));
}));
}
if first_run {