Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const initialState = {
- channel: null,
- currentRoom: {},
- };
- export default function (state = initialState, action) {
- switch (action.type) {
- case 'ROOM_CONNECTED_TO_CHANNEL':
- return {
- ...state,
- channel: action.channel,
- currentRoom: action.response.room,
- };
- case 'USER_LEFT_ROOM':
- return initialState;
- default:
- return state;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement