mobx 6.4.0 → 6.5.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 +18 -0
- package/dist/api/intercept.d.ts +1 -1
- package/dist/api/observe.d.ts +1 -1
- package/dist/core/reaction.d.ts +2 -2
- package/dist/mobx.cjs.development.js +1 -5
- 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 +1 -5
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +1 -5
- 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 +1 -5
- 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/types/observableset.d.ts +2 -2
- package/package.json +1 -1
- package/src/api/intercept.ts +1 -1
- package/src/api/observe.ts +1 -1
- package/src/core/derivation.ts +5 -1
- package/src/core/reaction.ts +2 -2
- package/src/types/observableset.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# mobx
|
|
2
2
|
|
|
3
|
+
## 6.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`767baff0`](https://github.com/mobxjs/mobx/commit/767baff0373e5a5e2b7da274b25042078f9a205c) [#3338](https://github.com/mobxjs/mobx/pull/3338) Thanks [@kubk](https://github.com/kubk)! - Replace any with a generic in Set methods
|
|
8
|
+
|
|
9
|
+
## 6.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`2caf7e1a`](https://github.com/mobxjs/mobx/commit/2caf7e1a3504dde3d7c9bde3c6fb56ca85168018) [#3316](https://github.com/mobxjs/mobx/pull/3316) Thanks [@urugator](https://github.com/urugator)! - `requiresObservable` always takes precedence over global `reactionRequiresObservable`
|
|
14
|
+
|
|
15
|
+
## 6.4.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`d6fa9a19`](https://github.com/mobxjs/mobx/commit/d6fa9a1970ebfb8a8adaf5bf0dc73125acec2dee) [#3306](https://github.com/mobxjs/mobx/pull/3306) Thanks [@urugator](https://github.com/urugator)! - fix missing type inferrence of `observe` and `intercept` for arrays
|
|
20
|
+
|
|
3
21
|
## 6.4.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/api/intercept.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IArrayWillChange, IArrayWillSplice, IInterceptor, IMapWillChange, IObjectWillChange, IObservableArray, IObservableValue, IValueWillChange, Lambda, ObservableMap, ObservableSet, ISetWillChange } from "../internal";
|
|
2
2
|
export declare function intercept<T>(value: IObservableValue<T>, handler: IInterceptor<IValueWillChange<T>>): Lambda;
|
|
3
|
-
export declare function intercept<T>(observableArray: IObservableArray<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
3
|
+
export declare function intercept<T>(observableArray: IObservableArray<T> | Array<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
4
4
|
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
5
5
|
export declare function intercept<V>(observableSet: ObservableSet<V> | Set<V>, handler: IInterceptor<ISetWillChange<V>>): Lambda;
|
|
6
6
|
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, property: K, handler: IInterceptor<IValueWillChange<V>>): Lambda;
|
package/dist/api/observe.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IArrayDidChange, IComputedValue, IMapDidChange, IObjectDidChange, IObservableArray, IObservableValue, IValueDidChange, Lambda, ObservableMap, ObservableSet, ISetDidChange } from "../internal";
|
|
2
2
|
export declare function observe<T>(value: IObservableValue<T> | IComputedValue<T>, listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
3
|
-
export declare function observe<T>(observableArray: IObservableArray<T>, listener: (change: IArrayDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
3
|
+
export declare function observe<T>(observableArray: IObservableArray<T> | Array<T>, listener: (change: IArrayDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
4
4
|
export declare function observe<V>(observableSet: ObservableSet<V> | Set<V>, listener: (change: ISetDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
|
5
5
|
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, listener: (change: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;
|
|
6
6
|
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, property: K, listener: (change: IValueDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
package/dist/core/reaction.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare class Reaction implements IDerivation, IReactionPublic {
|
|
|
29
29
|
name_: string;
|
|
30
30
|
private onInvalidate_;
|
|
31
31
|
private errorHandler_?;
|
|
32
|
-
requiresObservable_
|
|
32
|
+
requiresObservable_?: any;
|
|
33
33
|
observing_: IObservable[];
|
|
34
34
|
newObserving_: IObservable[];
|
|
35
35
|
dependenciesState_: IDerivationState_;
|
|
@@ -41,7 +41,7 @@ export declare class Reaction implements IDerivation, IReactionPublic {
|
|
|
41
41
|
isTrackPending_: boolean;
|
|
42
42
|
isRunning_: boolean;
|
|
43
43
|
isTracing_: TraceMode;
|
|
44
|
-
constructor(name_: string, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?:
|
|
44
|
+
constructor(name_: string, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?: any);
|
|
45
45
|
onBecomeStale_(): void;
|
|
46
46
|
schedule_(): void;
|
|
47
47
|
isScheduled(): boolean;
|
|
@@ -1966,7 +1966,7 @@ function warnAboutDerivationWithoutDependencies(derivation) {
|
|
|
1966
1966
|
return;
|
|
1967
1967
|
}
|
|
1968
1968
|
|
|
1969
|
-
if (
|
|
1969
|
+
if (typeof derivation.requiresObservable_ === "boolean" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {
|
|
1970
1970
|
console.warn("[mobx] Derivation '" + derivation.name_ + "' is created/updated without reading any observable value.");
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
@@ -2437,10 +2437,6 @@ var Reaction = /*#__PURE__*/function () {
|
|
|
2437
2437
|
name_ = "Reaction@" + getNextId() ;
|
|
2438
2438
|
}
|
|
2439
2439
|
|
|
2440
|
-
if (requiresObservable_ === void 0) {
|
|
2441
|
-
requiresObservable_ = false;
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
2440
|
this.name_ = void 0;
|
|
2445
2441
|
this.onInvalidate_ = void 0;
|
|
2446
2442
|
this.errorHandler_ = void 0;
|