UNPKG

1.02 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _redux = require('redux');
8
9var _pack = require('./pack');
10
11var _pack2 = _interopRequireDefault(_pack);
12
13var _unpack = require('./unpack');
14
15var _unpack2 = _interopRequireDefault(_unpack);
16
17function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19function _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
21function 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
33exports.default = wrap;
\No newline at end of file