dataflux 1.22.0 → 1.23.1

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
@@ -63,14 +63,19 @@ var Obj = exports["default"] = /*#__PURE__*/function (_BasicObj) {
63
63
  return _superPropGet((_this, Obj), "delete", _this, 3)([attribute]);
64
64
  });
65
65
  _defineProperty(_this, "set", function (attribute, value, hidden) {
66
- if (Array.isArray(value) && _this.getModel().options.deep) {
67
- value = value.map(function (i) {
68
- if (["boolean", "string", "number"].includes(_typeof(i))) {
69
- return i;
70
- } else {
71
- return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](_this, "property", i, _this.getModel());
72
- }
73
- });
66
+ if (_this.getModel().options.deep) {
67
+ if (Array.isArray(value)) {
68
+ value = value.map(function (i) {
69
+ if (["boolean", "string", "number"].includes(_typeof(i))) {
70
+ return i;
71
+ } else {
72
+ return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](_this, "property", i, _this.getModel());
73
+ }
74
+ });
75
+ } else if (_typeof(value) === "object") {
76
+ var _value;
77
+ value = (_value = value) !== null && _value !== void 0 && _value.getId ? value : new _SubObj["default"](_this, "property", value, _this.getModel());
78
+ }
74
79
  }
75
80
  return _superPropGet((_this, Obj), "set", _this, 3)([attribute, value, hidden]);
76
81
  });
@@ -143,8 +143,9 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
143
143
  return _createClass(ReactStore, [{
144
144
  key: "findAll",
145
145
  value: function findAll(type, stateAttribute, context, filterFunction) {
146
+ var _context$_isMounted;
146
147
  _assertClassBrand(_ReactStore_brand, this, _fixState).call(this, stateAttribute, context, false);
147
- context._isMounted = true;
148
+ (_context$_isMounted = context._isMounted) !== null && _context$_isMounted !== void 0 ? _context$_isMounted : context._isMounted = true;
148
149
  var subKey = this.subscribe(type, function (data) {
149
150
  if (context._isMounted) {
150
151
  setTimeout(function () {
@@ -160,8 +161,9 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
160
161
  }, {
161
162
  key: "findOne",
162
163
  value: function findOne(type, stateAttribute, context, filterFunction) {
164
+ var _context$_isMounted2;
163
165
  _assertClassBrand(_ReactStore_brand, this, _fixState).call(this, stateAttribute, context, true);
164
- context._isMounted = true;
166
+ (_context$_isMounted2 = context._isMounted) !== null && _context$_isMounted2 !== void 0 ? _context$_isMounted2 : context._isMounted = true;
165
167
  var subKey = this.subscribe(type, function (data) {
166
168
  if (context._isMounted) {
167
169
  setTimeout(context.setState(function (prev) {