Merge pull request #178 from autarch/autarch/spelling-fix

Fix misspelled variable name in usestate.rs
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2022-01-30 13:13:04 -05:00
commit 13cf95a9ea
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ impl<T> ProvidedStateInner<T> {
/// This hook provides some relatively light ergonomics around shared state.
///
/// It is not a substitute for a proper state management system, but it is capable enough to provide use_state - type
/// ergonimics in a pinch, with zero cost.
/// ergonomics in a pinch, with zero cost.
///
/// # Example
///
+2 -2
View File
@@ -153,8 +153,8 @@ impl<T: 'static> UseState<T> {
/// }
/// ```
pub fn modify(&self, f: impl FnOnce(&T) -> T) {
let curernt = self.slot.borrow();
let new_val = f(curernt.as_ref());
let current = self.slot.borrow();
let new_val = f(current.as_ref());
(self.setter)(new_val);
}