feat: improve safety

This commit is contained in:
Jonathan Kelley committed 2021-10-25 15:05:17 -04:00
1 parent 601078f9cf
commit fda2ebc2a2
12 files changed
+113 -36

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ impl<'a, T: 'static> UseSharedState<'a, T> {
///
///
/// TODO: We prevent unncessary notifications only in the hook, but we should figure out some more global lock
pub fn write(&self) -> RefMut<'_, T> {
pub fn write(&mut self) -> RefMut<'_, T> {
self.cx.needs_update();
self.notify_consumers();
self.value.borrow_mut()