feat: integrate fermi
This commit is contained in:
1 parent
3873cd1a60
commit
d461ffc011
23 files changed
+630
-15
No files matched your search
@@ -0,0 +1,11 @@
|
||||
use crate::AtomRoot;
|
||||
use dioxus_core::ScopeState;
|
||||
use std::rc::Rc;
|
||||
|
||||
// Initializes the atom root and retuns it;
|
||||
pub fn use_init_atom_root(cx: &ScopeState) -> &Rc<AtomRoot> {
|
||||
cx.use_hook(|_| match cx.consume_context::<AtomRoot>() {
|
||||
Some(ctx) => ctx,
|
||||
None => cx.provide_context(AtomRoot::new(cx.schedule_update_any())),
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user