mobx 6.10.1 → 6.10.2

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.
@@ -458,17 +458,15 @@ var Atom = /*#__PURE__*/function () {
458
458
  * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.
459
459
  */;
460
460
  _proto.reportChanged = function reportChanged() {
461
- if (globalState.inBatch && this.batchId_ === globalState.batchId) {
462
- // Called from the same batch this atom was created in.
463
- return;
461
+ if (!globalState.inBatch || this.batchId_ !== globalState.batchId) {
462
+ // We could update state version only at the end of batch,
463
+ // but we would still have to switch some global flag here to signal a change.
464
+ globalState.stateVersion = globalState.stateVersion < Number.MAX_SAFE_INTEGER ? globalState.stateVersion + 1 : Number.MIN_SAFE_INTEGER;
465
+ // Avoids the possibility of hitting the same globalState.batchId when it cycled through all integers (necessary?)
466
+ this.batchId_ = NaN;
464
467
  }
465
- // Avoids the possibility of hitting the same globalState.batchId when it cycled through all integers (necessary?)
466
- this.batchId_ = NaN;
467
468
  startBatch();
468
469
  propagateChanged(this);
469
- // We could update state version only at the end of batch,
470
- // but we would still have to switch some global flag here to signal a change.
471
- globalState.stateVersion = globalState.stateVersion < Number.MAX_SAFE_INTEGER ? globalState.stateVersion + 1 : Number.MIN_SAFE_INTEGER;
472
470
  endBatch();
473
471
  };
474
472
  _proto.toString = function toString() {