是的,您可以在您的应用程序中使用多个combineReducers,您可以在顶层将Reducer Home,Listing和Detail组合在一起,甚至将每个单独的reducer拆分为多个并将它们合并为一个.
根据Redux docs:
You may call combineReducers
at any level of the reducer hierarchy.
It doesn’t have to happen at the top. In fact you may use it again to
split the child reducers that get too complicated into independent
grandchildren,and so on.
关于combineReducer
的更多描述:
As your app grows more complex,you’ll want to split your reducing
function into separate functions,each managing independent parts of
the state.
The combineReducers
helper function turns an object whose values are
different reducing functions into a single reducing function you can
pass to createStore
.
The resulting reducer calls every child reducer,and gathers their results into a single state object. The shape of the state object matches the keys of the passed reducers.