import { ROOM_FILES } from '../actions/actionsTypes';
const initialState = {
messages: [],
ready: false
};
export default function server(state = initialState, action) {
switch (action.type) {
case ROOM_FILES.OPEN:
return {
...state,
case ROOM_FILES.READY:
ready: true
case ROOM_FILES.MESSAGES_RECEIVED:
messages: [...state.messages, ...action.messages]
case ROOM_FILES.CLOSE:
return initialState;
default:
return state;
}