diff --git a/packages/fermi/src/hooks/atom_ref.rs b/packages/fermi/src/hooks/atom_ref.rs index d2fa3f21..95732c49 100644 --- a/packages/fermi/src/hooks/atom_ref.rs +++ b/packages/fermi/src/hooks/atom_ref.rs @@ -70,6 +70,12 @@ impl UseAtomRef { self.value.borrow() } + /// This is silent operation + /// call `.force_update()` manually if required + pub fn with_mut_silent(&self, cb: impl FnOnce(&mut T)) { + cb(&mut *self.write_silent()) + } + pub fn write(&self) -> RefMut { self.root.force_update(self.ptr); self.value.borrow_mut()