"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.connection = connection;
var _socketActionTypes = require("../constants/socketActionTypes");
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 === _socketActionTypes.RECONNECT) {
    const {
      type,
      ...options
    } = action.options;
    return {
      ...state,
      type,
      options
    };
  }
  return state;
}