handle virtual dom switching

This commit is contained in:
Evan Almloff committed 2023-08-07 14:59:58 -07:00
1 parent ddbe913e79
commit 6ca170453b
3 files changed
+27 -10

No files matched your search

+15
View File
@@ -89,3 +89,18 @@ impl Runtime {
.ok()
}
}
pub struct RuntimeGuard(Rc<Runtime>);
impl RuntimeGuard {
pub fn new(runtime: Rc<Runtime>) -> Self {
push_runtime(runtime.clone());
Self(runtime)
}
}
impl Drop for RuntimeGuard {
fn drop(&mut self) {
pop_runtime();
}
}