dataflux 1.17.8 → 1.17.9

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/README.md CHANGED
@@ -296,7 +296,7 @@ class BookView extends React.Component {
296
296
  ```
297
297
  If you now do `books[0].set("price", 18)`, the BookView object will not update the price. You could address this by adding a `key={book.getFingerprint()}` prop. However, this approach forces the mounting of the component at every object change.
298
298
 
299
- A better approach is to use the method `didUpdate()` inside `componentDidUpdate` to check if any of the objects in the props changed.
299
+ A better approach is to use the method `didUpdate()` as below
300
300
 
301
301
  ```jsx
302
302
  class BookView extends React.Component {
@@ -304,7 +304,7 @@ class BookView extends React.Component {
304
304
  super(props);
305
305
  }
306
306
 
307
- componentDidUpdate() {
307
+ componentDidMount() {
308
308
  store.didUpdate(this);
309
309
  }
310
310
 
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _ObserverStore2 = _interopRequireDefault(require("./ObserverStore"));
9
+ var _uuid = require("uuid");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -66,17 +67,16 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
66
67
  var _i$isDataflux;
67
68
  return i === null || i === void 0 || (_i$isDataflux = i.isDataflux) === null || _i$isDataflux === void 0 ? void 0 : _i$isDataflux.call(i);
68
69
  });
69
- var _f = objects.map(function (i) {
70
- return i.getFingerprint();
71
- }).join(".");
72
- if (_f !== context.___obs_f) {
73
- context.forceUpdate();
74
- }
75
- context.___obs_f = _f;
70
+ objects.forEach(function (object) {
71
+ _this.findOne(object.getModel().getType(), (0, _uuid.v4)(), context, function (n) {
72
+ return object.getId() === n.getId();
73
+ });
74
+ });
76
75
  });
77
76
  _classPrivateFieldInitSpec(_this, _addSubscriptionToContext, function (context, subKey) {
77
+ var _context$___obs_subke;
78
78
  // I know...
79
- context.___obs_subkeys = context.___obs_subkeys || [];
79
+ (_context$___obs_subke = context.___obs_subkeys) !== null && _context$___obs_subke !== void 0 ? _context$___obs_subke : context.___obs_subkeys = [];
80
80
  context.___obs_subkeys.push(subKey);
81
81
  context.___obs_unsubscribe_context = _this;
82
82
  context.___obs_unsubscribe = function () {