only poll suspended futures

This commit is contained in:
Evan Almloff committed 2024-03-05 18:24:01 -06:00
1 parent 608fec59e5
commit c9603ea984
7 files changed
+140 -46

No files matched your search

+3 -3
View File
@@ -50,9 +50,9 @@ pub fn provide_root_context<T: 'static + Clone>(value: T) -> T {
.expect("to be in a dioxus runtime")
}
/// Suspends the current component
pub fn suspend() -> Option<Element> {
Runtime::with_current_scope(|cx| cx.suspend());
/// Suspended the current component on a specific task and then return None
pub fn suspend(task: Task) -> Element {
Runtime::with_current_scope(|cx| cx.suspend(task));
None
}