fix: ci and bug in setter

This commit is contained in:
Jonathan Kelley committed 2022-01-05 22:15:19 -05:00
1 parent 52d00eac0f
commit 4aadec1e30
3 files changed
+6 -17

No files matched your search

+5 -1
View File
@@ -59,7 +59,11 @@ impl<'a, T: 'static> UseState<'a, T> {
pub fn setter(&self) -> Rc<dyn Fn(T)> {
let slot = self.0.wip.clone();
Rc::new(move |new| *slot.borrow_mut() = Some(new))
let callback = self.0.update_callback.clone();
Rc::new(move |new| {
callback();
*slot.borrow_mut() = Some(new)
})
}
pub fn wtih(&self, f: impl FnOnce(&mut T)) {