pub struct PreferUseReducerRule { /* private fields */ }Expand description
Flags React components that have too many useState calls.
When a component accumulates many independent useState calls, it often
means the state values are related and would be better modelled as a single
useReducer. The threshold is configurable via max_count (default 4).
Implementations§
Source§impl PreferUseReducerRule
impl PreferUseReducerRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Rule for PreferUseReducerRule
impl Rule for PreferUseReducerRule
Auto Trait Implementations§
impl Freeze for PreferUseReducerRule
impl RefUnwindSafe for PreferUseReducerRule
impl Send for PreferUseReducerRule
impl Sync for PreferUseReducerRule
impl Unpin for PreferUseReducerRule
impl UnsafeUnpin for PreferUseReducerRule
impl UnwindSafe for PreferUseReducerRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more