fix: Read value from root when calling AtomState::current() (#1609)
This commit is contained in:
1 parent
a3e6d0adca
commit
bb5738a0ba
1 file changed
+3
-1
@@ -86,7 +86,9 @@ impl<T: 'static> AtomState<T> {
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn current(&self) -> Rc<T> {
|
||||
self.value.as_ref().unwrap().clone()
|
||||
let atoms = self.root.atoms.borrow();
|
||||
let slot = atoms.get(&self.id).unwrap();
|
||||
slot.value.clone().downcast().unwrap()
|
||||
}
|
||||
|
||||
/// Get the `setter` function directly without the `AtomState` wrapper.
|
||||
|
||||
Reference in new issue
Block a user