lml-main
Version:
This is now a mono repository published into many standalone packages.
27 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var Actions = require("../actions");
exports.initialAllocationTagState = {
byJobId: {},
};
exports.allocationTagReducer = function (state, action) {
if (state === void 0) { state = exports.initialAllocationTagState; }
switch (action.type) {
case Actions.SET_TAG_BY_ID: {
return setTagByJobId(state, action);
}
case Actions.SET_TAGS_BY_ID_BATCH: {
return setTagByJobIdBatch(state, action);
}
default: {
return state;
}
}
};
var setTagByJobId = function (state, action) {
return (tslib_1.__assign({}, state, { byJobId: tslib_1.__assign({}, state.byJobId, (_a = {}, _a[action.tag.job.refId] = action.tag, _a)) }));
var _a;
};
var setTagByJobIdBatch = function (state, action) { return (tslib_1.__assign({}, state, { byJobId: tslib_1.__assign({}, state.byJobId, action.tags) })); };
//# sourceMappingURL=tag.js.map