add simple suspense methods

This commit is contained in:
Jonathan Kelley committed 2023-07-14 16:56:17 -07:00
1 parent cbd88bbcc3
commit 81075748f6
11 files changed
+52 -189

No files matched your search

+2 -8
View File
@@ -1,5 +1,5 @@
use crate::{innerlude::SuspenseContext, ScopeId, TaskId, VirtualDom};
use std::{rc::Rc, task::Context};
use crate::{TaskId, VirtualDom};
use std::task::Context;
impl VirtualDom {
/// Handle notifications by tasks inside the scheduler
@@ -27,10 +27,4 @@ impl VirtualDom {
tasks.try_remove(id.0);
}
}
pub(crate) fn acquire_suspense_boundary(&self, id: ScopeId) -> Rc<SuspenseContext> {
self.scopes[id]
.consume_context::<Rc<SuspenseContext>>()
.unwrap()
}
}