oo-redux-utils
Advanced tools
Comparing version 1.23.13 to 1.24.0
@@ -14,18 +14,2 @@ "use strict"; | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -72,68 +56,2 @@ | ||
} | ||
}, { | ||
key: "dispatchDelayedAction", | ||
value: function dispatchDelayedAction(action, delayInMillis) { | ||
var _this2 = this; | ||
return setTimeout(function () { | ||
return _this2.dispatchAction_(action); | ||
}, delayInMillis); | ||
} | ||
}, { | ||
key: "dispatchIntervalAction", | ||
value: function dispatchIntervalAction(action, intervalInMillis) { | ||
var _this3 = this; | ||
return setInterval(function () { | ||
return _this3.dispatchAction_(action); | ||
}, intervalInMillis); | ||
} | ||
}, { | ||
key: "dispatchAsyncAction", | ||
value: function dispatchAsyncAction(actionClass, promise) { | ||
var _this4 = this; | ||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
if (this.stateNamespace) { | ||
promise.then(function (result) { | ||
return _this4.dispatchAction_(_construct(actionClass, [_this4.stateNamespace, result].concat(args))); | ||
}); | ||
} | ||
promise.then(function (result) { | ||
return _this4.dispatchAction_(_construct(actionClass, [result].concat(args))); | ||
}); | ||
} | ||
}, { | ||
key: "dispatchActionWithDi", | ||
value: function dispatchActionWithDi(diContainer, actionClass, otherArgs) { | ||
var _this5 = this; | ||
diContainer.create(actionClass, _objectSpread({ | ||
stateNamespace: this.stateNamespace, | ||
dispatchAction: this.dispatchAction_ | ||
}, otherArgs)).then(function (action) { | ||
return _this5.dispatchAction_(action); | ||
}); | ||
} | ||
}, { | ||
key: "dispatchActionsWithDi", | ||
value: function dispatchActionsWithDi(diContainer, actionDefs) { | ||
var _this6 = this; | ||
actionDefs.forEach(function (actionDef) { | ||
if (Array.isArray(actionDef)) { | ||
var _actionDef = _slicedToArray(actionDef, 2), | ||
actionClass = _actionDef[0], | ||
otherArgs = _actionDef[1]; | ||
_this6.dispatchActionWithDi(diContainer, actionClass, otherArgs); | ||
} else { | ||
_this6.dispatchAction(actionDef); | ||
} | ||
}); | ||
} | ||
}]); | ||
@@ -140,0 +58,0 @@ |
{ | ||
"name": "oo-redux-utils", | ||
"version": "1.23.13", | ||
"version": "1.24.0", | ||
"description": "Utility functions for Object-oriented Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
50328
334