dataflux 1.18.4 → 1.18.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/Obj.js CHANGED
@@ -71,21 +71,25 @@ var Obj = exports["default"] = /*#__PURE__*/function (_BasicObj) {
71
71
  }
72
72
  return _superPropGet((_this, Obj), "set", _this, 3)([attribute, value, hidden]);
73
73
  });
74
- _defineProperty(_this, "isLoaded", function () {
75
- return _classPrivateFieldGet(_loaded, _this);
74
+ _defineProperty(_this, "shouldLoad", function () {
75
+ var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
76
+ if (reset === null) {
77
+ return !_classPrivateFieldGet(_loaded, _this);
78
+ } else {
79
+ _classPrivateFieldSet(_loaded, _this, false);
80
+ }
76
81
  });
77
82
  _defineProperty(_this, "load", function () {
78
- if (_classPrivateFieldGet(_loaded, _this)) {
79
- return Promise.resolve(_this);
80
- } else {
83
+ if (!_classPrivateFieldGet(_loaded, _this)) {
81
84
  var model = _this.getModel();
82
- return model.load(_this).then(function () {
83
- _classPrivateFieldSet(_loaded, _this, true);
84
- return model.getStore().update([_this], true); // Propagate update
85
- }).then(function () {
85
+ _classPrivateFieldSet(_loaded, _this, model.load(_this).then(function () {
86
+ return model.getStore().update([_this], true);
87
+ }) // Propagate update
88
+ .then(function () {
86
89
  return _this;
87
- }); // return always this
90
+ })); // return always this
88
91
  }
92
+ return _classPrivateFieldGet(_loaded, _this);
89
93
  });
90
94
  _defineProperty(_this, "getFingerprint", function () {
91
95
  return (0, _objectFingerprint["default"])(_this.toJSON()).toString();
package/dist/Store.js CHANGED
@@ -196,6 +196,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
196
196
  (0, _BasicObj.setValues)(newObject, originalObject.getModel(), _SubObj["default"], originalObject, originalObject);
197
197
  });
198
198
  _classPrivateFieldInitSpec(this, _wipe, function (originalObject) {
199
+ originalObject === null || originalObject === void 0 || originalObject.shouldLoad(true);
199
200
  for (var key in originalObject) {
200
201
  if (key !== "id" && typeof originalObject[key] !== "function") {
201
202
  delete originalObject[key];