import { RECONNECT } from '../constants/socketActionTypes';
export function connection() {
  let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
    options: {
      hostname: 'localhost',
      port: 8000,
      secure: false
    },
    type: 'disabled'
  };
  let action = arguments.length > 1 ? arguments[1] : undefined;
  if (action.type === RECONNECT) {
    const {
      type,
      ...options
    } = action.options;
    return {
      ...state,
      type,
      options
    };
  }
  return state;
}