export reducers = combineReducers ({
app: ...,
user: ...,
display:...,
})
//在配置文件中
const rootReducer = combineReducers ({
form: formReducer,
apollo: apolloReducer,
reducers
})
这会导致状态树看起来像这样,
{
form: {...},
apollo: {...},
reducers: {
app: {...},
user: {...},
display: {...}
}
}
我想要这个......
{
form: {...},
apollo: {...},
app: {...},
user: {...},
display: {...}
}
我试过......减速器但是没有用。提前致谢
答案 0 :(得分:2)
你可以拥有一个包含所有缩减器的对象,
export reducers = {
app: ...,
user: ...,
display:...,
}
然后你可以
const rootReducer = combineReducers ({
form: formReducer,
apollo: apolloReducer,
...reducers
})