Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function updateRoundPhase(state, phase) {
switch (phase) {
case RoundPhases.IDLE:
case RoundPhases.COUNTDOWN:
// TODO: use cleanRoundState and updateRound as handlers of roundPhase change (to RoundPhases.IDLE)
return Object.assign({}, state, cleanRoundState(state), { phase });
case RoundPhases.IN_PROGRESS:
case RoundPhases.END:
return Object.assign({}, state, { phase });
default:
error('Unknown round phase');
return state;
}
}
function updateRoundPhase(state, phase) {
switch (phase) {
case RoundPhases.IDLE:
case RoundPhases.COUNTDOWN:
case RoundPhases.IN_PROGRESS:
case RoundPhases.END:
return Object.assign({}, state, { phase });
default:
error('Unknown round phase');
return state;
}
}
.on('disconnected', () => {
error('server disconnected');
dispatch(updateConnectionStatus(false));
})
.on('message', (incomingMessage) => {