mobx 6.13.1 → 6.13.3

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.
@@ -202,15 +202,24 @@ function createInstanceofPredicate(name, theClass) {
202
202
  return isObject(x) && x[propName] === true;
203
203
  };
204
204
  }
205
+ /**
206
+ * Yields true for both native and observable Map, even across different windows.
207
+ */
205
208
  function isES6Map(thing) {
206
209
  return thing != null && Object.prototype.toString.call(thing) === "[object Map]";
207
210
  }
211
+ /**
212
+ * Makes sure a Map is an instance of non-inherited native or observable Map.
213
+ */
208
214
  function isPlainES6Map(thing) {
209
215
  var mapProto = Object.getPrototypeOf(thing);
210
216
  var objectProto = Object.getPrototypeOf(mapProto);
211
217
  var nullProto = Object.getPrototypeOf(objectProto);
212
218
  return nullProto === null;
213
219
  }
220
+ /**
221
+ * Yields true for both native and observable Set, even across different windows.
222
+ */
214
223
  function isES6Set(thing) {
215
224
  return thing != null && Object.prototype.toString.call(thing) === "[object Set]";
216
225
  }
@@ -696,12 +705,19 @@ function decorate_20223_$1(mthd, context) {
696
705
  var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
697
706
  return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);
698
707
  };
699
- // Backwards/Legacy behavior, expects makeObservable(this)
700
708
  if (kind == "field") {
701
- addInitializer(function () {
702
- storeAnnotation(this, name, ann);
703
- });
704
- return;
709
+ return function (initMthd) {
710
+ var _ann$options_3;
711
+ var mthd = initMthd;
712
+ if (!isAction(mthd)) {
713
+ mthd = _createAction(mthd);
714
+ }
715
+ if ((_ann$options_3 = ann.options_) != null && _ann$options_3.bound) {
716
+ mthd = mthd.bind(this);
717
+ mthd.isMobxAction = true;
718
+ }
719
+ return mthd;
720
+ };
705
721
  }
706
722
  if (kind == "method") {
707
723
  var _this$options_2;
@@ -4767,7 +4783,7 @@ var ObservableSet = /*#__PURE__*/function () {
4767
4783
  });
4768
4784
  };
4769
4785
  _proto.intersection = function intersection(otherSet) {
4770
- if (isES6Set(otherSet)) {
4786
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4771
4787
  return otherSet.intersection(this);
4772
4788
  } else {
4773
4789
  var dehancedSet = new Set(this);
@@ -4775,7 +4791,7 @@ var ObservableSet = /*#__PURE__*/function () {
4775
4791
  }
4776
4792
  };
4777
4793
  _proto.union = function union(otherSet) {
4778
- if (isES6Set(otherSet)) {
4794
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4779
4795
  return otherSet.union(this);
4780
4796
  } else {
4781
4797
  var dehancedSet = new Set(this);
@@ -4786,7 +4802,7 @@ var ObservableSet = /*#__PURE__*/function () {
4786
4802
  return new Set(this).difference(otherSet);
4787
4803
  };
4788
4804
  _proto.symmetricDifference = function symmetricDifference(otherSet) {
4789
- if (isES6Set(otherSet)) {
4805
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4790
4806
  return otherSet.symmetricDifference(this);
4791
4807
  } else {
4792
4808
  var dehancedSet = new Set(this);
@@ -4800,7 +4816,7 @@ var ObservableSet = /*#__PURE__*/function () {
4800
4816
  return new Set(this).isSupersetOf(otherSet);
4801
4817
  };
4802
4818
  _proto.isDisjointFrom = function isDisjointFrom(otherSet) {
4803
- if (isES6Set(otherSet)) {
4819
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4804
4820
  return otherSet.isDisjointFrom(this);
4805
4821
  } else {
4806
4822
  var dehancedSet = new Set(this);