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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/dist/mobx.cjs.development.js +25 -9
- package/dist/mobx.cjs.development.js.map +1 -1
- package/dist/mobx.cjs.production.min.js +1 -1
- package/dist/mobx.cjs.production.min.js.map +1 -1
- package/dist/mobx.esm.development.js +25 -9
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +25 -9
- package/dist/mobx.esm.js.map +1 -1
- package/dist/mobx.esm.production.min.js +1 -1
- package/dist/mobx.esm.production.min.js.map +1 -1
- package/dist/mobx.umd.development.js +25 -9
- package/dist/mobx.umd.development.js.map +1 -1
- package/dist/mobx.umd.production.min.js +1 -1
- package/dist/mobx.umd.production.min.js.map +1 -1
- package/dist/utils/utils.d.ts +12 -3
- package/package.json +1 -1
- package/src/types/actionannotation.ts +12 -7
- package/src/types/observableset.ts +4 -4
- package/src/utils/utils.ts +12 -3
|
@@ -208,15 +208,24 @@
|
|
|
208
208
|
return isObject(x) && x[propName] === true;
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Yields true for both native and observable Map, even across different windows.
|
|
213
|
+
*/
|
|
211
214
|
function isES6Map(thing) {
|
|
212
215
|
return thing != null && Object.prototype.toString.call(thing) === "[object Map]";
|
|
213
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Makes sure a Map is an instance of non-inherited native or observable Map.
|
|
219
|
+
*/
|
|
214
220
|
function isPlainES6Map(thing) {
|
|
215
221
|
var mapProto = Object.getPrototypeOf(thing);
|
|
216
222
|
var objectProto = Object.getPrototypeOf(mapProto);
|
|
217
223
|
var nullProto = Object.getPrototypeOf(objectProto);
|
|
218
224
|
return nullProto === null;
|
|
219
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Yields true for both native and observable Set, even across different windows.
|
|
228
|
+
*/
|
|
220
229
|
function isES6Set(thing) {
|
|
221
230
|
return thing != null && Object.prototype.toString.call(thing) === "[object Set]";
|
|
222
231
|
}
|
|
@@ -702,12 +711,19 @@
|
|
|
702
711
|
var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
|
|
703
712
|
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);
|
|
704
713
|
};
|
|
705
|
-
// Backwards/Legacy behavior, expects makeObservable(this)
|
|
706
714
|
if (kind == "field") {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
715
|
+
return function (initMthd) {
|
|
716
|
+
var _ann$options_3;
|
|
717
|
+
var mthd = initMthd;
|
|
718
|
+
if (!isAction(mthd)) {
|
|
719
|
+
mthd = _createAction(mthd);
|
|
720
|
+
}
|
|
721
|
+
if ((_ann$options_3 = ann.options_) != null && _ann$options_3.bound) {
|
|
722
|
+
mthd = mthd.bind(this);
|
|
723
|
+
mthd.isMobxAction = true;
|
|
724
|
+
}
|
|
725
|
+
return mthd;
|
|
726
|
+
};
|
|
711
727
|
}
|
|
712
728
|
if (kind == "method") {
|
|
713
729
|
var _this$options_2;
|
|
@@ -4773,7 +4789,7 @@
|
|
|
4773
4789
|
});
|
|
4774
4790
|
};
|
|
4775
4791
|
_proto.intersection = function intersection(otherSet) {
|
|
4776
|
-
if (isES6Set(otherSet)) {
|
|
4792
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4777
4793
|
return otherSet.intersection(this);
|
|
4778
4794
|
} else {
|
|
4779
4795
|
var dehancedSet = new Set(this);
|
|
@@ -4781,7 +4797,7 @@
|
|
|
4781
4797
|
}
|
|
4782
4798
|
};
|
|
4783
4799
|
_proto.union = function union(otherSet) {
|
|
4784
|
-
if (isES6Set(otherSet)) {
|
|
4800
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4785
4801
|
return otherSet.union(this);
|
|
4786
4802
|
} else {
|
|
4787
4803
|
var dehancedSet = new Set(this);
|
|
@@ -4792,7 +4808,7 @@
|
|
|
4792
4808
|
return new Set(this).difference(otherSet);
|
|
4793
4809
|
};
|
|
4794
4810
|
_proto.symmetricDifference = function symmetricDifference(otherSet) {
|
|
4795
|
-
if (isES6Set(otherSet)) {
|
|
4811
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4796
4812
|
return otherSet.symmetricDifference(this);
|
|
4797
4813
|
} else {
|
|
4798
4814
|
var dehancedSet = new Set(this);
|
|
@@ -4806,7 +4822,7 @@
|
|
|
4806
4822
|
return new Set(this).isSupersetOf(otherSet);
|
|
4807
4823
|
};
|
|
4808
4824
|
_proto.isDisjointFrom = function isDisjointFrom(otherSet) {
|
|
4809
|
-
if (isES6Set(otherSet)) {
|
|
4825
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4810
4826
|
return otherSet.isDisjointFrom(this);
|
|
4811
4827
|
} else {
|
|
4812
4828
|
var dehancedSet = new Set(this);
|