我不明白减压器是什么意思.如果我有2个包含相同动作的reducer功能,它是否可以使用?
function reducerA(state, action){
switch(action.type):
...
case 'SAME_ACTION': {...state, field: state.field+1}
}
function reducerB(state, action){
switch(action.type):
...
case 'SAME_ACTION': {...state, field: state.field*2}
}
Run Code Online (Sandbox Code Playgroud)
所以,如果我调用并且调用reduceReducer了动作"SAME_ACTION",那么我会有下一个状态吗?reducerAreducerB{field: 0}{field: 2}
在我看来,它有点连接缩减器(意味着将它们合并在一个键下).
我是对的还是reduceReducer服务于不同的目的?