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
package/dist/mobx.esm.js
CHANGED
|
@@ -203,15 +203,24 @@ function createInstanceofPredicate(name, theClass) {
|
|
|
203
203
|
return isObject(x) && x[propName] === true;
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Yields true for both native and observable Map, even across different windows.
|
|
208
|
+
*/
|
|
206
209
|
function isES6Map(thing) {
|
|
207
210
|
return thing != null && Object.prototype.toString.call(thing) === "[object Map]";
|
|
208
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Makes sure a Map is an instance of non-inherited native or observable Map.
|
|
214
|
+
*/
|
|
209
215
|
function isPlainES6Map(thing) {
|
|
210
216
|
var mapProto = Object.getPrototypeOf(thing);
|
|
211
217
|
var objectProto = Object.getPrototypeOf(mapProto);
|
|
212
218
|
var nullProto = Object.getPrototypeOf(objectProto);
|
|
213
219
|
return nullProto === null;
|
|
214
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Yields true for both native and observable Set, even across different windows.
|
|
223
|
+
*/
|
|
215
224
|
function isES6Set(thing) {
|
|
216
225
|
return thing != null && Object.prototype.toString.call(thing) === "[object Set]";
|
|
217
226
|
}
|
|
@@ -697,12 +706,19 @@ function decorate_20223_$1(mthd, context) {
|
|
|
697
706
|
var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
|
|
698
707
|
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);
|
|
699
708
|
};
|
|
700
|
-
// Backwards/Legacy behavior, expects makeObservable(this)
|
|
701
709
|
if (kind == "field") {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
710
|
+
return function (initMthd) {
|
|
711
|
+
var _ann$options_3;
|
|
712
|
+
var mthd = initMthd;
|
|
713
|
+
if (!isAction(mthd)) {
|
|
714
|
+
mthd = _createAction(mthd);
|
|
715
|
+
}
|
|
716
|
+
if ((_ann$options_3 = ann.options_) != null && _ann$options_3.bound) {
|
|
717
|
+
mthd = mthd.bind(this);
|
|
718
|
+
mthd.isMobxAction = true;
|
|
719
|
+
}
|
|
720
|
+
return mthd;
|
|
721
|
+
};
|
|
706
722
|
}
|
|
707
723
|
if (kind == "method") {
|
|
708
724
|
var _this$options_2;
|
|
@@ -4792,7 +4808,7 @@ var ObservableSet = /*#__PURE__*/function () {
|
|
|
4792
4808
|
});
|
|
4793
4809
|
};
|
|
4794
4810
|
_proto.intersection = function intersection(otherSet) {
|
|
4795
|
-
if (isES6Set(otherSet)) {
|
|
4811
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4796
4812
|
return otherSet.intersection(this);
|
|
4797
4813
|
} else {
|
|
4798
4814
|
var dehancedSet = new Set(this);
|
|
@@ -4800,7 +4816,7 @@ var ObservableSet = /*#__PURE__*/function () {
|
|
|
4800
4816
|
}
|
|
4801
4817
|
};
|
|
4802
4818
|
_proto.union = function union(otherSet) {
|
|
4803
|
-
if (isES6Set(otherSet)) {
|
|
4819
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4804
4820
|
return otherSet.union(this);
|
|
4805
4821
|
} else {
|
|
4806
4822
|
var dehancedSet = new Set(this);
|
|
@@ -4811,7 +4827,7 @@ var ObservableSet = /*#__PURE__*/function () {
|
|
|
4811
4827
|
return new Set(this).difference(otherSet);
|
|
4812
4828
|
};
|
|
4813
4829
|
_proto.symmetricDifference = function symmetricDifference(otherSet) {
|
|
4814
|
-
if (isES6Set(otherSet)) {
|
|
4830
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4815
4831
|
return otherSet.symmetricDifference(this);
|
|
4816
4832
|
} else {
|
|
4817
4833
|
var dehancedSet = new Set(this);
|
|
@@ -4825,7 +4841,7 @@ var ObservableSet = /*#__PURE__*/function () {
|
|
|
4825
4841
|
return new Set(this).isSupersetOf(otherSet);
|
|
4826
4842
|
};
|
|
4827
4843
|
_proto.isDisjointFrom = function isDisjointFrom(otherSet) {
|
|
4828
|
-
if (isES6Set(otherSet)) {
|
|
4844
|
+
if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
|
|
4829
4845
|
return otherSet.isDisjointFrom(this);
|
|
4830
4846
|
} else {
|
|
4831
4847
|
var dehancedSet = new Set(this);
|