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