lucid-ui
Version:
A UI component library from AppNexus.
25 lines • 1.03 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var lodash_1 = __importDefault(require("lodash"));
exports.default = {
onSelect: function (state, index) {
if (state === void 0) { state = { selectedIndices: [] }; }
var currentIndices = lodash_1.default.get(state, 'selectedIndices', []);
return __assign(__assign({}, state), { selectedIndices: lodash_1.default.xor(currentIndices, [index]) });
},
};
//# sourceMappingURL=ButtonGroup.reducers.js.map