mobx 6.5.0 → 6.6.0
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 +6 -0
- package/README.md +1 -1
- package/dist/api/observable.d.ts +5 -1
- package/dist/mobx.cjs.development.js +15 -15
- 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 +15 -15
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +15 -15
- 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 +15 -15
- 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/package.json +1 -1
- package/src/api/observable.ts +7 -2
- package/src/mobx.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# mobx
|
|
2
2
|
|
|
3
|
+
## 6.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`8e204c7b`](https://github.com/mobxjs/mobx/commit/8e204c7b7d1dbad597761fa83beda77f027ee34c) [#3409](https://github.com/mobxjs/mobx/pull/3409) Thanks [@Nokel81](https://github.com/Nokel81)! - Remove observable.box type inconsistancy
|
|
8
|
+
|
|
3
9
|
## 6.5.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ _Simple, scalable state management._
|
|
|
15
15
|
|
|
16
16
|
> Documentation for older **unsupported** V4/V5 can be [found here](https://github.com/mobxjs/mobx/blob/mobx4and5/docs/README.md), but be sure to read about [current documentation first](https://mobx.js.org/about-this-documentation.html).
|
|
17
17
|
|
|
18
|
-
MobX is made possible by the generosity of the sponsors below, and many other [individual backers](docs/backers-sponsors.md#backers). Sponsoring directly impacts the longevity of this project.
|
|
18
|
+
MobX is made possible by the generosity of the sponsors below, and many other [individual backers](https://github.com/mobxjs/mobx/blob/main/docs/backers-sponsors.md#backers). Sponsoring directly impacts the longevity of this project.
|
|
19
19
|
|
|
20
20
|
**🥇 Gold sponsors (\$3000+ total contribution):** <br/>
|
|
21
21
|
<a href="https://mendix.com/"><img src="https://mobx.js.org/assets/mendix-logo.png" align="center" width="100" title="Mendix" alt="Mendix" /></a>
|
package/dist/api/observable.d.ts
CHANGED
|
@@ -16,12 +16,16 @@ export declare function asCreateObservableOptions(thing: any): CreateObservableO
|
|
|
16
16
|
export declare function getEnhancerFromOptions(options: CreateObservableOptions): IEnhancer<any>;
|
|
17
17
|
export declare function getAnnotationFromOptions(options?: CreateObservableOptions): Annotation | undefined;
|
|
18
18
|
export declare function getEnhancerFromAnnotation(annotation?: Annotation): IEnhancer<any>;
|
|
19
|
+
export interface IObservableValueFactory {
|
|
20
|
+
<T>(value: T, options?: CreateObservableOptions): IObservableValue<T>;
|
|
21
|
+
<T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>;
|
|
22
|
+
}
|
|
19
23
|
export interface IObservableFactory extends Annotation, PropertyDecorator {
|
|
20
24
|
<T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
21
25
|
<T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
22
26
|
<K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
23
27
|
<T extends object>(value: T, decorators?: AnnotationsMap<T, never>, options?: CreateObservableOptions): T;
|
|
24
|
-
box:
|
|
28
|
+
box: IObservableValueFactory;
|
|
25
29
|
array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>;
|
|
26
30
|
set: <T = any>(initialValues?: IObservableSetInitialValues<T>, options?: CreateObservableOptions) => ObservableSet<T>;
|
|
27
31
|
map: <K = any, V = any>(initialValues?: IObservableMapInitialValues<K, V>, options?: CreateObservableOptions) => ObservableMap<K, V>;
|
|
@@ -1350,7 +1350,7 @@ function allowStateChangesEnd(prev) {
|
|
|
1350
1350
|
var _Symbol$toPrimitive;
|
|
1351
1351
|
var CREATE = "create";
|
|
1352
1352
|
_Symbol$toPrimitive = Symbol.toPrimitive;
|
|
1353
|
-
var ObservableValue = /*#__PURE__*/function (_Atom
|
|
1353
|
+
var ObservableValue = /*#__PURE__*/function (_Atom) {
|
|
1354
1354
|
_inheritsLoose(ObservableValue, _Atom);
|
|
1355
1355
|
|
|
1356
1356
|
function ObservableValue(value, enhancer, name_, notifySpy, equals) {
|
|
@@ -1510,12 +1510,12 @@ var ObservableValue = /*#__PURE__*/function (_Atom, _Symbol$toPrimitive2) {
|
|
|
1510
1510
|
return toPrimitive(this.get());
|
|
1511
1511
|
};
|
|
1512
1512
|
|
|
1513
|
-
_proto[_Symbol$
|
|
1513
|
+
_proto[_Symbol$toPrimitive] = function () {
|
|
1514
1514
|
return this.valueOf();
|
|
1515
1515
|
};
|
|
1516
1516
|
|
|
1517
1517
|
return ObservableValue;
|
|
1518
|
-
}(Atom
|
|
1518
|
+
}(Atom);
|
|
1519
1519
|
var isObservableValue = /*#__PURE__*/createInstanceofPredicate("ObservableValue", ObservableValue);
|
|
1520
1520
|
|
|
1521
1521
|
var _Symbol$toPrimitive$1;
|
|
@@ -1540,7 +1540,7 @@ var _Symbol$toPrimitive$1;
|
|
|
1540
1540
|
*/
|
|
1541
1541
|
|
|
1542
1542
|
_Symbol$toPrimitive$1 = Symbol.toPrimitive;
|
|
1543
|
-
var ComputedValue = /*#__PURE__*/function (
|
|
1543
|
+
var ComputedValue = /*#__PURE__*/function () {
|
|
1544
1544
|
// nodes we are looking at. Our value depends on these nodes
|
|
1545
1545
|
// during tracking it's an array with new observed observers
|
|
1546
1546
|
// to check for cycles
|
|
@@ -1797,12 +1797,12 @@ var ComputedValue = /*#__PURE__*/function (_Symbol$toPrimitive2) {
|
|
|
1797
1797
|
return toPrimitive(this.get());
|
|
1798
1798
|
};
|
|
1799
1799
|
|
|
1800
|
-
_proto[_Symbol$
|
|
1800
|
+
_proto[_Symbol$toPrimitive$1] = function () {
|
|
1801
1801
|
return this.valueOf();
|
|
1802
1802
|
};
|
|
1803
1803
|
|
|
1804
1804
|
return ComputedValue;
|
|
1805
|
-
}(
|
|
1805
|
+
}();
|
|
1806
1806
|
var isComputedValue = /*#__PURE__*/createInstanceofPredicate("ComputedValue", ComputedValue);
|
|
1807
1807
|
|
|
1808
1808
|
var IDerivationState_;
|
|
@@ -4482,7 +4482,7 @@ var DELETE = "delete"; // just extend Map? See also https://gist.github.com/nest
|
|
|
4482
4482
|
|
|
4483
4483
|
_Symbol$iterator = Symbol.iterator;
|
|
4484
4484
|
_Symbol$toStringTag = Symbol.toStringTag;
|
|
4485
|
-
var ObservableMap = /*#__PURE__*/function (
|
|
4485
|
+
var ObservableMap = /*#__PURE__*/function () {
|
|
4486
4486
|
// hasMap, not hashMap >-).
|
|
4487
4487
|
function ObservableMap(initialData, enhancer_, name_) {
|
|
4488
4488
|
var _this = this;
|
|
@@ -4766,7 +4766,7 @@ var ObservableMap = /*#__PURE__*/function (_Symbol$iterator2, _Symbol$toStringTa
|
|
|
4766
4766
|
});
|
|
4767
4767
|
};
|
|
4768
4768
|
|
|
4769
|
-
_proto[_Symbol$
|
|
4769
|
+
_proto[_Symbol$iterator] = function () {
|
|
4770
4770
|
return this.entries();
|
|
4771
4771
|
};
|
|
4772
4772
|
|
|
@@ -4958,14 +4958,14 @@ var ObservableMap = /*#__PURE__*/function (_Symbol$iterator2, _Symbol$toStringTa
|
|
|
4958
4958
|
return this.data_.size;
|
|
4959
4959
|
}
|
|
4960
4960
|
}, {
|
|
4961
|
-
key: _Symbol$
|
|
4961
|
+
key: _Symbol$toStringTag,
|
|
4962
4962
|
get: function get() {
|
|
4963
4963
|
return "Map";
|
|
4964
4964
|
}
|
|
4965
4965
|
}]);
|
|
4966
4966
|
|
|
4967
4967
|
return ObservableMap;
|
|
4968
|
-
}(
|
|
4968
|
+
}(); // eslint-disable-next-line
|
|
4969
4969
|
|
|
4970
4970
|
var isObservableMap = /*#__PURE__*/createInstanceofPredicate("ObservableMap", ObservableMap);
|
|
4971
4971
|
|
|
@@ -4991,7 +4991,7 @@ var _Symbol$iterator$1, _Symbol$toStringTag$1;
|
|
|
4991
4991
|
var ObservableSetMarker = {};
|
|
4992
4992
|
_Symbol$iterator$1 = Symbol.iterator;
|
|
4993
4993
|
_Symbol$toStringTag$1 = Symbol.toStringTag;
|
|
4994
|
-
var ObservableSet = /*#__PURE__*/function (
|
|
4994
|
+
var ObservableSet = /*#__PURE__*/function () {
|
|
4995
4995
|
function ObservableSet(initialData, enhancer, name_) {
|
|
4996
4996
|
if (enhancer === void 0) {
|
|
4997
4997
|
enhancer = deepEnhancer;
|
|
@@ -5252,7 +5252,7 @@ var ObservableSet = /*#__PURE__*/function (_Symbol$iterator2, _Symbol$toStringTa
|
|
|
5252
5252
|
return "[object ObservableSet]";
|
|
5253
5253
|
};
|
|
5254
5254
|
|
|
5255
|
-
_proto[_Symbol$
|
|
5255
|
+
_proto[_Symbol$iterator$1] = function () {
|
|
5256
5256
|
return this.values();
|
|
5257
5257
|
};
|
|
5258
5258
|
|
|
@@ -5263,14 +5263,14 @@ var ObservableSet = /*#__PURE__*/function (_Symbol$iterator2, _Symbol$toStringTa
|
|
|
5263
5263
|
return this.data_.size;
|
|
5264
5264
|
}
|
|
5265
5265
|
}, {
|
|
5266
|
-
key: _Symbol$
|
|
5266
|
+
key: _Symbol$toStringTag$1,
|
|
5267
5267
|
get: function get() {
|
|
5268
5268
|
return "Set";
|
|
5269
5269
|
}
|
|
5270
5270
|
}]);
|
|
5271
5271
|
|
|
5272
5272
|
return ObservableSet;
|
|
5273
|
-
}(
|
|
5273
|
+
}(); // eslint-disable-next-line
|
|
5274
5274
|
|
|
5275
5275
|
var isObservableSet = /*#__PURE__*/createInstanceofPredicate("ObservableSet", ObservableSet);
|
|
5276
5276
|
|
|
@@ -6431,7 +6431,7 @@ function isAnnotation(thing) {
|
|
|
6431
6431
|
* (c) Michel Weststrate 2015 - 2020
|
|
6432
6432
|
* MIT Licensed
|
|
6433
6433
|
*
|
|
6434
|
-
* Welcome to the mobx sources! To get
|
|
6434
|
+
* Welcome to the mobx sources! To get a global overview of how MobX internally works,
|
|
6435
6435
|
* this is a good place to start:
|
|
6436
6436
|
* https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74
|
|
6437
6437
|
*
|