Recently I stumbled upon the codebase where every reducer looks like the following. I guess they are spreading initialState
to get rid of some 'leftover' nested state when reducer initialises, but is it meaningful?
const initialState = {...}
const reducer = (state = {...initialState}, action) => {
...
}