get compiling

This commit is contained in:
Jonathan Kelley committed 2024-01-11 16:51:18 -08:00
1 parent 2ae3241cc0
commit 8c94f0bc4a
18 files changed
+325 -344

No files matched your search

+2 -2
View File
@@ -391,13 +391,13 @@ impl ScopeId {
}
/// Spawn a future on a component given its [`ScopeId`].
pub fn spawn_at(fut: impl Future<Output = ()> + 'static, scope_id: ScopeId) -> Option<TaskId> {
pub fn spawn_at(fut: impl Future<Output = ()> + 'static, scope_id: ScopeId) -> Option<Task> {
with_runtime(|rt| rt.get_context(scope_id).unwrap().push_future(fut))
}
/// Spawn a future that Dioxus won't clean up when this component is unmounted
///
/// This is good for tasks that need to be run after the component has been dropped.
pub fn spawn_forever(fut: impl Future<Output = ()> + 'static) -> Option<TaskId> {
pub fn spawn_forever(fut: impl Future<Output = ()> + 'static) -> Option<Task> {
spawn_at(fut, ScopeId(0))
}