调度减少器
只是简化的 ,它使您可以通过直接调度reducer来更简单地创建动作。
store . dispatch ( state => ( { ... state , counter : state . counter + 1 } ) ) ;
在此术语中,动作是返回归约器的函数:
const increment = amount => state => ( {
... state ,
counter : state . counter + amount
} ) ;
store . dispatch ( increment ( 42 ) ) ;
动机
具有详细的操作管理。 大多