/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var Action = require('../actionNames');
exports.initialState = {
isReadOnly: false
};
function setReadOnly(isReadOnly) {
return function (dispatch) {
dispatch(setReadOnlyAction(isReadOnly));
};
}
exports.setReadOnly = setReadOnly;
function setReadOnlyAction(isReadOnly) {
return {
type: Action.SET_READONLY,
isReadOnly: isReadOnly
};
}
function global(state, action) {
if (state === void 0) { state = exports.initialState; }
switch (action.type) {
case Action.SET_READONLY:
return Object.assign({}, state, {
isReadOnly: action.isReadOnly
});
default:
return state;
}
}
exports.global = global;
|