mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
feat: add "spawn" method
This commit is contained in:
parent
508f7e9c40
commit
bad4b773b7
1 changed files with 5 additions and 0 deletions
|
@ -751,6 +751,11 @@ impl ScopeState {
|
|||
self.tasks.push_fut(fut)
|
||||
}
|
||||
|
||||
/// Spawns the future but does not return the TaskId
|
||||
pub fn spawn(&self, fut: impl Future<Output = ()> + 'static) {
|
||||
self.push_future(fut);
|
||||
}
|
||||
|
||||
// todo: attach some state to the future to know if we should poll it
|
||||
pub fn remove_future(&self, id: TaskId) {
|
||||
self.tasks.remove_fut(id);
|
||||
|
|
Loading…
Reference in a new issue