combineReducers
这一块的类型如何配置? 实在不行,只能用any大法了!
源代码:
import { combineReducers } from 'redux-immutable'
import { Record, List, Map } from 'immutable'
interface AkamaComponent {
uuid: any
componentType: string
props: Array<string | {}>
}
interface State {
components: List<Record<AkamaComponent>>
menuComponents: Map<any, any>
}
const StateRecord = Record({
components: List([]),
menuComponents: Map({}),
})
const reducersMap = {
components: (state: Record<List<AkamaComponent>>, action: any) => {
return state
},
menuComponents: (state: Record<Map<any, any>>, action: any) => {
return state
},
}
const rootReducer = combineReducers<State>(reducersMap, StateRecord)
export default rootReducer
测试连接:demo