create Signal::global
This commit is contained in:
1 parent
3dce650367
commit
bc914deeaa
23 files changed
+324
-1105
No files matched your search
@@ -390,4 +390,9 @@ impl ScopeId {
|
||||
pub fn height(self) -> u32 {
|
||||
Runtime::with_scope(self, |cx| cx.height()).expect("to be in a dioxus runtime")
|
||||
}
|
||||
|
||||
/// Run a closure inside of scope's runtime
|
||||
pub fn in_runtime<T>(self, f: impl FnOnce() -> T) -> T {
|
||||
Runtime::with_scope(self, |_| f()).expect("to be in a dioxus runtime")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user