'use strict';

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

var _reduxActions = require('redux-actions');

var _constants = require('../constants');

var constants = _interopRequireWildcard(_constants);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function changeFilename(state, action) {
  if (action.filename) {
    return state.set('filename', action.filename);
  }
  return state;
}

exports.default = (0, _reduxActions.handleActions)({
  [constants.CHANGE_FILENAME]: changeFilename,
  [constants.SET_NOTEBOOK]: changeFilename }, {});