import { ROOM } from '../actions/actionsTypes';
const initialState = {
rid: null,
isDeleting: false,
rooms: []
};
export default function(state = initialState, action) {
switch (action.type) {
case ROOM.SUBSCRIBE:
return {
...state,
rooms: [action.rid, ...state.rooms]
case ROOM.UNSUBSCRIBE:
rooms: state.rooms
.filter(room => room.rid === action.rid)
case ROOM.LEAVE:
rid: action.rid,
isDeleting: true
case ROOM.DELETE:
case ROOM.CLOSE:
case ROOM.FORWARD:
case ROOM.REMOVED:
isDeleting: false
default:
return state;
}