wip: move examples around

This commit is contained in:
Jonathan Kelley committed 2021-11-03 15:13:50 -04:00
1 parent d298b626d3
commit 1e6e5e611b
86 files changed
+160 -216

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(&mut self) -> RefMut<'_, T> {
pub fn write(&self) -> RefMut<'_, T> {
self.cx.needs_update();
self.notify_consumers();
self.value.borrow_mut()
+1 -1
View File
@@ -102,7 +102,7 @@ impl<'a, T: 'static> UseState<'a, T> {
}
}
pub fn set(&mut self, new_val: T) {
pub fn set(&self, new_val: T) {
*self.inner.wip.borrow_mut() = Some(new_val);
self.needs_update();
}