1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.asyncMapClearOperation = exports.asyncMapDeleteOperation = exports.asyncMapSetOperation = void 0;
|
9 |
|
10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
11 |
|
12 | var _objectSpread3 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectSpread"));
|
13 |
|
14 | var del = function del(obj, key) {
|
15 | var newObj = (0, _objectSpread3.default)({}, obj);
|
16 | delete newObj[key];
|
17 | return newObj;
|
18 | };
|
19 |
|
20 | var asyncMapSetOperation = function asyncMapSetOperation(state, key) {
|
21 | var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
22 | return (0, _objectSpread3.default)({}, state, (0, _defineProperty2.default)({}, key, value));
|
23 | };
|
24 |
|
25 | exports.asyncMapSetOperation = asyncMapSetOperation;
|
26 |
|
27 | var asyncMapDeleteOperation = function asyncMapDeleteOperation(state, key) {
|
28 | return del(state, key);
|
29 | };
|
30 |
|
31 | exports.asyncMapDeleteOperation = asyncMapDeleteOperation;
|
32 |
|
33 | var asyncMapClearOperation = function asyncMapClearOperation(state, key) {
|
34 | return typeof key === 'string' ? (0, _defineProperty2.default)({}, key, state[key]) : {};
|
35 | };
|
36 |
|
37 | exports.asyncMapClearOperation = asyncMapClearOperation; |
\ | No newline at end of file |