|
@@ -4,6 +4,7 @@ use std::{
|
|
|
cell::{Ref, RefCell, RefMut},
|
|
|
rc::Rc,
|
|
|
};
|
|
|
+use std::ops::DerefMut;
|
|
|
|
|
|
///
|
|
|
///
|
|
@@ -70,6 +71,12 @@ impl<T: 'static> UseAtomRef<T> {
|
|
|
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(self.write_silent().deref_mut())
|
|
|
+ }
|
|
|
+
|
|
|
pub fn write(&self) -> RefMut<T> {
|
|
|
self.root.force_update(self.ptr);
|
|
|
self.value.borrow_mut()
|