handle virtual dom switching
This commit is contained in:
1 parent
ddbe913e79
commit
6ca170453b
3 files changed
+27
-10
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user