1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _redux = require('redux');
|
8 |
|
9 | var _pack = require('./pack');
|
10 |
|
11 | var _pack2 = _interopRequireDefault(_pack);
|
12 |
|
13 | var _unpack = require('./unpack');
|
14 |
|
15 | var _unpack2 = _interopRequireDefault(_unpack);
|
16 |
|
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18 |
|
19 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
20 |
|
21 | function wrap() {
|
22 | var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
23 | idField = _ref.idField,
|
24 | operations = _ref.operations;
|
25 |
|
26 | if (!operations) {
|
27 | throw new Error('tree.wrap - Missing operations!');
|
28 | }
|
29 |
|
30 | return _redux.compose.apply(undefined, [(0, _unpack2.default)({ idField: idField })].concat(_toConsumableArray(operations), [(0, _pack2.default)({ idField: idField })]));
|
31 | }
|
32 |
|
33 | exports.default = wrap; |
\ | No newline at end of file |