Queue effects to run after flush_sync

This commit is contained in:
Jonathan Kelley committed 2024-01-28 02:21:05 -08:00
1 parent 7e4a1e9c7c
commit 1847c737e9
8 files changed
+137 -59

No files matched your search

+1 -3
View File
@@ -71,7 +71,7 @@ pub fn spawn_forever(fut: impl Future<Output = ()> + 'static) -> Option<Task> {
///
/// This drops the task immediately.
pub fn remove_future(id: Task) {
Runtime::with_current_scope(|cx| cx.remove_future(id));
Runtime::with(|rt| rt.remove_task(id)).expect("Runtime to exist");
}
/// Store a value between renders. The foundational hook for all other hooks.
@@ -94,7 +94,6 @@ pub fn use_hook<State: Clone + 'static>(initializer: impl FnOnce() -> State) ->
Runtime::with_current_scope(|cx| cx.use_hook(initializer)).expect("to be in a dioxus runtime")
}
/// Get the current render since the inception of this component
///
/// This can be used as a helpful diagnostic when debugging hooks/renders, etc
@@ -217,7 +216,6 @@ pub fn use_drop<D: FnOnce() + 'static>(destroy: D) {
});
}
/// Push a function to be run before the next render
/// This is a hook and will always run, so you can't unschedule it
/// Will run for every progression of suspense, though this might change in the future