score:0

Accepted answer
export default function reducer(state = initialState, action = {}) {
    switch (action.type) {
        [...]
        case POST_MESSAGE:
            return {
                ...state,
                messages: {
                    ...state.messages,
                    [action.id]: { ...action.message }
                }
            }
        [...]
    }
}

Related Query

More Query from same tag