feat: apply local router changes
This commit is contained in:
1 parent
3928856a9b
commit
f2979cb12a
28 files changed
+672
-516
No files matched your search
@@ -4,8 +4,8 @@ use std::rc::Rc;
|
||||
|
||||
// Returns the atom root, initiaizing it at the root of the app if it does not exist.
|
||||
pub fn use_atom_root(cx: &ScopeState) -> &Rc<AtomRoot> {
|
||||
cx.use_hook(|_| match cx.consume_context::<AtomRoot>() {
|
||||
cx.use_hook(|_| match cx.consume_context::<Rc<AtomRoot>>() {
|
||||
Some(root) => root,
|
||||
None => cx.provide_root_context(AtomRoot::new(cx.schedule_update_any())),
|
||||
None => cx.provide_root_context(Rc::new(AtomRoot::new(cx.schedule_update_any()))),
|
||||
})
|
||||
}
|
||||
@@ -4,8 +4,8 @@ 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>() {
|
||||
cx.use_hook(|_| match cx.consume_context::<Rc<AtomRoot>>() {
|
||||
Some(ctx) => ctx,
|
||||
None => cx.provide_context(AtomRoot::new(cx.schedule_update_any())),
|
||||
None => cx.provide_context(Rc::new(AtomRoot::new(cx.schedule_update_any()))),
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user