@steroidsjs/core 2.2.99 → 2.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/reducers/list.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.99",
3
+ "version": "2.2.100",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
package/reducers/list.js CHANGED
@@ -10,6 +10,11 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
14
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
15
+ to[j] = from[i];
16
+ return to;
17
+ };
13
18
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
19
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
20
  };
@@ -93,10 +98,10 @@ var reducerMap = (_a = {},
93
98
  var selectedIds = get_1["default"](state, ['selectedIds', action.listId]) || [];
94
99
  var index = selectedIds.indexOf(action.itemId);
95
100
  if (index === -1) {
96
- selectedIds.push(action.itemId);
101
+ selectedIds = __spreadArray(__spreadArray([], selectedIds), [action.itemId]);
97
102
  }
98
103
  else {
99
- selectedIds.splice(index, 1);
104
+ selectedIds = selectedIds.filter(function (selectedId) { return selectedId !== action.itemId; });
100
105
  }
101
106
  return __assign(__assign({}, state), { selectedIds: __assign(__assign({}, state.selectedIds), (_a = {}, _a[action.listId] = [].concat(selectedIds), _a)) });
102
107
  },