dataflux 1.19.5 → 1.19.6

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.
package/dist/Model.js CHANGED
@@ -95,7 +95,7 @@ var Model = exports["default"] = /*#__PURE__*/_createClass(function Model(name)
95
95
  _options$pre,
96
96
  _ref9,
97
97
  _options$hiddenFields,
98
- _ref10,
98
+ _ref0,
99
99
  _options$post;
100
100
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
101
101
  var defaults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -422,7 +422,7 @@ var Model = exports["default"] = /*#__PURE__*/_createClass(function Model(name)
422
422
  autoRefresh: (_ref7 = (_options$autoRefresh = options.autoRefresh) !== null && _options$autoRefresh !== void 0 ? _options$autoRefresh : defaults.autoRefresh) !== null && _ref7 !== void 0 ? _ref7 : false,
423
423
  pre: (_ref8 = (_options$pre = options.pre) !== null && _options$pre !== void 0 ? _options$pre : defaults.pre) !== null && _ref8 !== void 0 ? _ref8 : null,
424
424
  hiddenFields: (_ref9 = (_options$hiddenFields = options.hiddenFields) !== null && _options$hiddenFields !== void 0 ? _options$hiddenFields : defaults.hiddenFields) !== null && _ref9 !== void 0 ? _ref9 : [],
425
- post: (_ref10 = (_options$post = options.post) !== null && _options$post !== void 0 ? _options$post : defaults.post) !== null && _ref10 !== void 0 ? _ref10 : null
425
+ post: (_ref0 = (_options$post = options.post) !== null && _options$post !== void 0 ? _options$post : defaults.post) !== null && _ref0 !== void 0 ? _ref0 : null
426
426
  });
427
427
  _classPrivateFieldSet(_store, this, null);
428
428
  _classPrivateFieldSet(_includes, this, {});
@@ -435,12 +435,12 @@ var Model = exports["default"] = /*#__PURE__*/_createClass(function Model(name)
435
435
  if (_classPrivateFieldGet(_loadFunction, this) && typeof _classPrivateFieldGet(_loadFunction, this) !== "function") {
436
436
  throw new Error("The load option must be a function");
437
437
  }
438
- var _ref11 = _typeof(options) === "object" ? (0, _modelHooksUtils.getHooksFromOptions)(options) : (0, _modelHooksUtils.getHooksFromUrl)(options),
439
- _ref12 = _slicedToArray(_ref11, 4),
440
- retrieveHook = _ref12[0],
441
- insertHook = _ref12[1],
442
- updateHook = _ref12[2],
443
- deleteHook = _ref12[3];
438
+ var _ref1 = _typeof(options) === "object" ? (0, _modelHooksUtils.getHooksFromOptions)(options) : (0, _modelHooksUtils.getHooksFromUrl)(options),
439
+ _ref10 = _slicedToArray(_ref1, 4),
440
+ retrieveHook = _ref10[0],
441
+ insertHook = _ref10[1],
442
+ updateHook = _ref10[2],
443
+ deleteHook = _ref10[3];
444
444
  _classPrivateFieldSet(_retrieveHook, this, retrieveHook);
445
445
  _classPrivateFieldSet(_updateHook, this, updateHook);
446
446
  _classPrivateFieldSet(_insertHook, this, insertHook);
package/dist/Store.js CHANGED
@@ -446,7 +446,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
446
446
  }, {
447
447
  key: "factory",
448
448
  value: function factory(type, params) {
449
- var _this10 = this;
449
+ var _this0 = this;
450
450
  var item = this.models[type];
451
451
  this.pubSub.publish("loading", {
452
452
  status: "start",
@@ -458,14 +458,14 @@ var Store = exports["default"] = /*#__PURE__*/function () {
458
458
  try {
459
459
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
460
460
  var _item = _step5.value;
461
- _classPrivateFieldGet(_insertObject, _this10).call(_this10, type, _item, "old");
461
+ _classPrivateFieldGet(_insertObject, _this0).call(_this0, type, _item, "old");
462
462
  }
463
463
  } catch (err) {
464
464
  _iterator5.e(err);
465
465
  } finally {
466
466
  _iterator5.f();
467
467
  }
468
- _this10.pubSub.publish("loading", {
468
+ _this0.pubSub.publish("loading", {
469
469
  status: "end",
470
470
  model: type
471
471
  });
@@ -477,7 +477,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
477
477
  }, {
478
478
  key: "_getPromise",
479
479
  value: function _getPromise(type) {
480
- var _this11 = this;
480
+ var _this1 = this;
481
481
  var ifLoaded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
482
482
  if (!this.models[type]) {
483
483
  return Promise.reject("The model doesn't exist");
@@ -485,7 +485,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
485
485
  return Promise.reject("The model is not loaded");
486
486
  } else if (!this.models[type].promise && this.options.lazyLoad && !ifLoaded) {
487
487
  return _assertClassBrand(_Store_brand, this, _loadObjects).call(this, type).then(function () {
488
- return _this11.models[type].promise;
488
+ return _this1.models[type].promise;
489
489
  });
490
490
  } else if (!this.models[type].promise && this.options.lazyLoad && ifLoaded) {
491
491
  return Promise.resolve();
@@ -496,9 +496,9 @@ var Store = exports["default"] = /*#__PURE__*/function () {
496
496
  }, {
497
497
  key: "getCollection",
498
498
  value: function getCollection(type) {
499
- var _this12 = this;
499
+ var _this10 = this;
500
500
  return this._getPromise(type).then(function () {
501
- return Object.values(_this12.models[type].storedObjects).filter(function (i) {
501
+ return Object.values(_this10.models[type].storedObjects).filter(function (i) {
502
502
  return i.status !== "deleted";
503
503
  }).filter(function (i) {
504
504
  return i.status !== "mock";
@@ -519,9 +519,9 @@ function _error(error) {
519
519
  return Promise.reject(error);
520
520
  }
521
521
  function _deleteByFilter(type, filterFunction) {
522
- var _this13 = this;
522
+ var _this11 = this;
523
523
  return this._getPromise(type).then(function () {
524
- var deleted = Object.values(_this13.models[type].storedObjects).filter(function (i) {
524
+ var deleted = Object.values(_this11.models[type].storedObjects).filter(function (i) {
525
525
  return filterFunction(i.object);
526
526
  });
527
527
  var _iterator6 = _createForOfIteratorHelper(deleted),
@@ -542,7 +542,7 @@ function _deleteByFilter(type, filterFunction) {
542
542
  });
543
543
  }
544
544
  function _loadObjects(type) {
545
- var _this14 = this;
545
+ var _this12 = this;
546
546
  var item = this.models[type];
547
547
  this.pubSub.publish("loading", {
548
548
  status: "start",
@@ -554,14 +554,14 @@ function _loadObjects(type) {
554
554
  try {
555
555
  for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
556
556
  var _item2 = _step7.value;
557
- _classPrivateFieldGet(_insertObject, _this14).call(_this14, type, _item2, "old");
557
+ _classPrivateFieldGet(_insertObject, _this12).call(_this12, type, _item2, "old");
558
558
  }
559
559
  } catch (err) {
560
560
  _iterator7.e(err);
561
561
  } finally {
562
562
  _iterator7.f();
563
563
  }
564
- _this14.pubSub.publish("loading", {
564
+ _this12.pubSub.publish("loading", {
565
565
  status: "end",
566
566
  model: type
567
567
  });