Skip to content

Instantly share code, notes, and snippets.

@bnhansn
Created October 22, 2016 12:48
Show Gist options
  • Save bnhansn/0c2030d823d4e912cc420dcaf214545f to your computer and use it in GitHub Desktop.
Save bnhansn/0c2030d823d4e912cc420dcaf214545f to your computer and use it in GitHub Desktop.
const initialState = {
willAuthenticate: true,
isAuthenticated: false,
currentUser: {},
socket: null, // new line
};
// ...
case 'LOGOUT':
return {
...state,
willAuthenticate: false,
isAuthenticated: false,
currentUser: {},
socket: null, // new line
};
case 'SOCKET_CONNECTED': // new case
return {
...state,
socket: action.socket,
};
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment