"use strict";

exports.__esModule = true;
exports.updateReadOnlyMode = exports.toggleReadOnlyMode = exports["default"] = void 0;
var _reduxAct = require("redux-act");
var _createMetaAction = _interopRequireDefault(require("./utils/createMetaAction"));
var _createReducer;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
// ------------------------------------
// Actions
// ------------------------------------
var toggleReadOnlyMode = (0, _createMetaAction["default"])("TOGGLE_READ_ONLY_MODE", function () {}); //NOTE!!:: second argument sanitizes actions so no payload is passed
exports.toggleReadOnlyMode = toggleReadOnlyMode;
var updateReadOnlyMode = (0, _createMetaAction["default"])("UPDATE_READ_ONLY_MODE");

// ------------------------------------
// Reducer
// ------------------------------------
exports.updateReadOnlyMode = updateReadOnlyMode;
var _default = (0, _reduxAct.createReducer)((_createReducer = {}, _createReducer[updateReadOnlyMode] = function (state, payload) {
  return payload;
}, _createReducer[toggleReadOnlyMode] = function (state) {
  return !state;
}, _createReducer), true);
exports["default"] = _default;