Fix effect ordering after reruns

This commit is contained in:
Evan Almloff committed 2024-03-01 12:46:07 -06:00
1 parent 26f5fb80cb
commit a14e5be7ad
8 files changed
+89 -51

No files matched your search

+1 -4
View File
@@ -260,10 +260,7 @@ pub fn after_render(f: impl FnMut() + 'static) {
pub async fn flush_sync() {
// Wait for the flush lock to be available
// We release it immediately, so it's impossible for the lock to be held longer than this function
Runtime::with(|rt| rt.flush_mutex.clone())
.unwrap()
.lock()
.await;
Runtime::with(|rt| rt.render_signal.subscribe()).unwrap().await;
}
/// Use a hook with a cleanup function