0
所以我有一大堆的鴨式的終極版的模塊,像這樣:終極版,行動handleActions是不會改變的狀態
import { createAction, handleActions } from 'redux-actions'
const SET = "error/SET"
const CLEAR = "error/CLEAR"
export default handleActions({
SET: (error, action) => action.payload,
CLEAR: (error, action) => ""
}, "")
export const setError = createAction(SET)
export const clearError = createAction(CLEAR)
然後,在reducers.js我這樣做:
import error from './error'
export default combineReducers({
error,
...
})
但
,當我派遣(SETERROR(「ERROR」))我看到終極版devtools的動作,但狀態不改變