'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = configureStore;

var _redux = require('redux');

var _middlewares = require('./middlewares');

var _middlewares2 = _interopRequireDefault(_middlewares);

var _reducers = require('./reducers');

var _reducers2 = _interopRequireDefault(_reducers);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* istanbul ignore if -- only used for debugging */
if (process.env.DEBUG) {
  const logger = require('./logger'); // eslint-disable-line global-require

  _middlewares2.default.push(logger());
}

function configureStore(initialState) {
  return (0, _redux.createStore)(_reducers2.default, initialState, (0, _redux.applyMiddleware)(..._middlewares2.default));
}