porkchopclub/porkchop

View on GitHub
app/javascript/reducers/connection.js

Summary

Maintainability
A
0 mins
Test Coverage
import { handleActions } from 'redux-actions'

import {
  ongoingMatchDisconnected,
  ongoingMatchConnected
} from '../actions/ongoingMatch'

export default handleActions({
  [ongoingMatchDisconnected]: (state, action) => ({ connected: false }),
  [ongoingMatchConnected]: (state, action) => ({ connected: true }),
}, { connected: false })