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
}
combineSlicesmakes it very convenient to just docombineSlices(sliceA, sliceB), because it automatically mounts slices under theirreducerPath. It would be very convenient to also be able to do something likeconfigureStore({ reducer: [sliceA, sliceB] })and letconfigureStorecallcombineSlicesautomatically.It's worth noting that
combineSlicessupercedescombineReducersmeaning that whereconfigureStorecurrently callscombineReducerscould be replaced withcombineSlices. (this would also support doingconfigureStore({ reducer: fooSlice })but I don't know if we want to support that types-wise)