Open
Description
combineSlices
makes it very convenient to just do combineSlices(sliceA, sliceB)
, because it automatically mounts slices under their reducerPath
. It would be very convenient to also be able to do something like configureStore({ reducer: [sliceA, sliceB] })
and let configureStore
call combineSlices
automatically.
It's worth noting that combineSlices
supercedes combineReducers
meaning that where configureStore
currently calls combineReducers
could be replaced with combineSlices
. (this would also support doing configureStore({ reducer: fooSlice })
but I don't know if we want to support that types-wise)
let reducer: Reducer<S, A>;
if (typeof options.reducer === "object") {
reducer = Array.isArray(options.reducer) ? combineSlices(...options.reducer) : combineSlices(options.reducer)
} else {
reducer = options.reducer
}