description TODO import { MessagesReducerState } from '@/ServerManager/type' ; import * as types from '../actions/actionTypes' ; const initialState = { streams : { } , } ; const messagesReducer = ( state = initialState , action ) => { switch ( action . type ) { case types . CREATE_STREAM : { return { ... state , streams : { ... state . streams , [ action . payload ] : [ ] , } , } ; } case types . LOG_MESSAGE : { const { id , message } = action . payload ; const stream = state . streams [ id ] ; stream . push ( message ) ; return { ... state , streams : { ... state . streams , [ id ] : stream , } , } ; } default : { return state ; } } } ; export default messagesReducer ;