Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function handleClientAction(action, phoenix, dispatch, getState) {
switch (action.type) {
case RoundActions.SELECTED_ROUND:
return phoenix.send(frontService.puzzleIndexSet(action.payload));
case RoundActions.START_ROUND:
return phoenix.send(frontService.roundStart());
case RoundActions.STOP_ROUND:
return phoenix.send(frontService.roundStop());
default:
return log('Skip action reaction:', action.type);
}
}
function handleClientAction(action, phoenix, dispatch, getState) {
switch (action.type) {
case RoundActions.SOLUTION:
return handleClientSolution(phoenix, action.payload, dispatch);
default:
return log('Skip action reaction:', action.type);
}
}
.on('disconnected', () => {
log('server disconnected');
dispatch(updateConnectionStatus(false));
})
.on('message', (incomingMessage) => {
.on('message', (incomingMessage) => {
log('server message', incomingMessage);
const { message } = parseMessage(incomingMessage.data);
handleServerMessage(message, dispatch);
});
.on('message', (incomingMessage) => {
log('server message', incomingMessage);
const { message } = parseMessage(incomingMessage.data);
handleServerMessage(message, dispatch);
});
.on('connected', () => {
log('server connected');
dispatch(updateConnectionStatus(true));
})
.on('disconnected', () => {
.on('connected', () => {
log('server connected');
dispatch(updateConnectionStatus(true));
})
.on('disconnected', () => {