Last active
October 22, 2016 13:25
-
-
Save bnhansn/7742fa7634646db4518b9c9bab127145 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment