mobx 6.15.0 → 6.15.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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/api/flow.d.ts +4 -4
- package/dist/mobx.cjs.development.js +68 -8
- 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.d.ts +1 -1
- package/dist/mobx.esm.development.js +68 -8
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +68 -8
- 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 +68 -8
- 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 +5 -5
- package/src/api/flow.ts +10 -3
- package/src/mobx.ts +1 -0
package/dist/mobx.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IObservable, IDepTreeNode, Reaction, IReactionPublic, IReactionDisposer, untracked, IAtom, createAtom, spy, IComputedValue, IEqualsComparer, comparer, IEnhancer, IInterceptable, IInterceptor, IListenable, IObjectWillChange, IObjectDidChange, isObservableObject, IValueDidChange, IValueWillChange, IObservableValue, isObservableValue as isBoxedObservable, IObservableArray, IArrayWillChange, IArrayWillSplice, IArraySplice, IArrayUpdate, IArrayDidChange, isObservableArray, IKeyValueMap, ObservableMap, IMapEntries, IMapEntry, IMapWillChange, IMapDidChange, isObservableMap, IObservableMapInitialValues, ObservableSet, isObservableSet, ISetDidChange, ISetWillChange, IObservableSetInitialValues, transaction, observable, IObservableFactory, CreateObservableOptions, computed, IComputedFactory, isObservable, isObservableProp, isComputed, isComputedProp, extendObservable, observe, intercept, autorun, IAutorunOptions, reaction, IReactionOptions, when, IWhenOptions, action, isAction, runInAction, IActionFactory, keys, values, entries, set, remove, has, get, apiOwnKeys as ownKeys, apiDefineProperty as defineProperty, configure, onBecomeObserved, onBecomeUnobserved, flow, isFlow, flowResult, FlowCancellationError, isFlowCancellationError, toJS, trace, IObserverTree, IDependencyTree, getDependencyTree, getObserverTree, resetGlobalState as _resetGlobalState, getGlobalState as _getGlobalState, getDebugName, getAtom, getAdministration as _getAdministration, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, // This has become the default behavior in Mobx 6
|
|
1
|
+
export { IObservable, IDepTreeNode, Reaction, IReactionPublic, IReactionDisposer, untracked, IAtom, createAtom, spy, IComputedValue, IEqualsComparer, comparer, IEnhancer, IInterceptable, IInterceptor, IListenable, IObjectWillChange, IObjectDidChange, isObservableObject, IValueDidChange, IValueWillChange, IObservableValue, isObservableValue as isBoxedObservable, IObservableArray, IArrayWillChange, IArrayWillSplice, IArraySplice, IArrayUpdate, IArrayDidChange, isObservableArray, IKeyValueMap, ObservableMap, IMapEntries, IMapEntry, IMapWillChange, IMapDidChange, isObservableMap, IObservableMapInitialValues, ObservableSet, isObservableSet, ISetDidChange, ISetWillChange, IObservableSetInitialValues, transaction, observable, IObservableFactory, CreateObservableOptions, computed, IComputedFactory, isObservable, isObservableProp, isComputed, isComputedProp, extendObservable, observe, intercept, autorun, IAutorunOptions, reaction, IReactionOptions, when, IWhenOptions, action, isAction, runInAction, IActionFactory, keys, values, entries, set, remove, has, get, apiOwnKeys as ownKeys, apiDefineProperty as defineProperty, configure, onBecomeObserved, onBecomeUnobserved, flow, isFlow, flowResult, CancellablePromise, FlowCancellationError, isFlowCancellationError, toJS, trace, IObserverTree, IDependencyTree, getDependencyTree, getObserverTree, resetGlobalState as _resetGlobalState, getGlobalState as _getGlobalState, getDebugName, getAtom, getAdministration as _getAdministration, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, // This has become the default behavior in Mobx 6
|
|
2
2
|
Lambda, $mobx, isComputingDerivation as _isComputingDerivation, onReactionError, interceptReads as _interceptReads, IComputedValueOptions, IActionRunInfo, _startAction, _endAction, allowStateReadsStart as _allowStateReadsStart, allowStateReadsEnd as _allowStateReadsEnd, makeObservable, makeAutoObservable, autoAction as _autoAction, AnnotationsMap, AnnotationMapEntry, override } from "./internal";
|
|
@@ -288,6 +288,13 @@ function _arrayLikeToArray(r, a) {
|
|
|
288
288
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
289
289
|
return n;
|
|
290
290
|
}
|
|
291
|
+
function _construct(t, e, r) {
|
|
292
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
293
|
+
var o = [null];
|
|
294
|
+
o.push.apply(o, e);
|
|
295
|
+
var p = new (t.bind.apply(t, o))();
|
|
296
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
297
|
+
}
|
|
291
298
|
function _defineProperties(e, r) {
|
|
292
299
|
for (var t = 0; t < r.length; t++) {
|
|
293
300
|
var o = r[t];
|
|
@@ -325,9 +332,29 @@ function _extends() {
|
|
|
325
332
|
return n;
|
|
326
333
|
}, _extends.apply(null, arguments);
|
|
327
334
|
}
|
|
335
|
+
function _getPrototypeOf(t) {
|
|
336
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
337
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
338
|
+
}, _getPrototypeOf(t);
|
|
339
|
+
}
|
|
328
340
|
function _inheritsLoose(t, o) {
|
|
329
341
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
330
342
|
}
|
|
343
|
+
function _isNativeFunction(t) {
|
|
344
|
+
try {
|
|
345
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
346
|
+
} catch (n) {
|
|
347
|
+
return "function" == typeof t;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function _isNativeReflectConstruct() {
|
|
351
|
+
try {
|
|
352
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
353
|
+
} catch (t) {}
|
|
354
|
+
return (_isNativeReflectConstruct = function () {
|
|
355
|
+
return !!t;
|
|
356
|
+
})();
|
|
357
|
+
}
|
|
331
358
|
function _setPrototypeOf(t, e) {
|
|
332
359
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
333
360
|
return t.__proto__ = e, t;
|
|
@@ -354,6 +381,28 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
354
381
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
355
382
|
}
|
|
356
383
|
}
|
|
384
|
+
function _wrapNativeSuper(t) {
|
|
385
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
386
|
+
return _wrapNativeSuper = function (t) {
|
|
387
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
388
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
389
|
+
if (void 0 !== r) {
|
|
390
|
+
if (r.has(t)) return r.get(t);
|
|
391
|
+
r.set(t, Wrapper);
|
|
392
|
+
}
|
|
393
|
+
function Wrapper() {
|
|
394
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
395
|
+
}
|
|
396
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
397
|
+
constructor: {
|
|
398
|
+
value: Wrapper,
|
|
399
|
+
enumerable: !1,
|
|
400
|
+
writable: !0,
|
|
401
|
+
configurable: !0
|
|
402
|
+
}
|
|
403
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
404
|
+
}, _wrapNativeSuper(t);
|
|
405
|
+
}
|
|
357
406
|
|
|
358
407
|
var storedAnnotationsSymbol = /*#__PURE__*/Symbol("mobx-stored-annotations");
|
|
359
408
|
/**
|
|
@@ -1572,7 +1621,7 @@ var ComputedValue = /*#__PURE__*/function () {
|
|
|
1572
1621
|
}
|
|
1573
1622
|
}
|
|
1574
1623
|
// to check for cycles
|
|
1575
|
-
|
|
1624
|
+
;
|
|
1576
1625
|
/**
|
|
1577
1626
|
* Returns the current value of this computed value.
|
|
1578
1627
|
* Will evaluate its computation first if needed.
|
|
@@ -3012,10 +3061,21 @@ function unique(list) {
|
|
|
3012
3061
|
}
|
|
3013
3062
|
|
|
3014
3063
|
var generatorId = 0;
|
|
3015
|
-
function
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3064
|
+
var FlowCancellationError = /*#__PURE__*/function (_Error) {
|
|
3065
|
+
function FlowCancellationError() {
|
|
3066
|
+
var _this;
|
|
3067
|
+
_this = _Error.call(this, "FLOW_CANCELLED") || this;
|
|
3068
|
+
Object.setPrototypeOf(_this, (this instanceof FlowCancellationError ? this.constructor : void 0).prototype);
|
|
3069
|
+
_this.name = "FlowCancellationError";
|
|
3070
|
+
return _this;
|
|
3071
|
+
}
|
|
3072
|
+
_inheritsLoose(FlowCancellationError, _Error);
|
|
3073
|
+
var _proto = FlowCancellationError.prototype;
|
|
3074
|
+
_proto.toString = function toString() {
|
|
3075
|
+
return "Error: " + this.message;
|
|
3076
|
+
};
|
|
3077
|
+
return FlowCancellationError;
|
|
3078
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
3019
3079
|
function isFlowCancellationError(error) {
|
|
3020
3080
|
return error instanceof FlowCancellationError;
|
|
3021
3081
|
}
|
|
@@ -5027,7 +5087,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
|
|
|
5027
5087
|
}
|
|
5028
5088
|
}
|
|
5029
5089
|
// Trap for "in"
|
|
5030
|
-
|
|
5090
|
+
;
|
|
5031
5091
|
_proto.has_ = function has_(key) {
|
|
5032
5092
|
if (!globalState.trackingDerivation) {
|
|
5033
5093
|
// Skip key subscription outside derivation
|
|
@@ -5159,7 +5219,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
|
|
|
5159
5219
|
return true;
|
|
5160
5220
|
}
|
|
5161
5221
|
// If original descriptor becomes relevant, move this to annotation directly
|
|
5162
|
-
|
|
5222
|
+
;
|
|
5163
5223
|
_proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {
|
|
5164
5224
|
if (proxyTrap === void 0) {
|
|
5165
5225
|
proxyTrap = false;
|
|
@@ -5211,7 +5271,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
|
|
|
5211
5271
|
return true;
|
|
5212
5272
|
}
|
|
5213
5273
|
// If original descriptor becomes relevant, move this to annotation directly
|
|
5214
|
-
|
|
5274
|
+
;
|
|
5215
5275
|
_proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {
|
|
5216
5276
|
if (proxyTrap === void 0) {
|
|
5217
5277
|
proxyTrap = false;
|