mobx 7.0.3 → 7.0.4
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 +10 -0
- package/dist/api/makeObservable.d.ts +0 -2
- package/dist/core/reaction.d.ts +1 -1
- package/dist/mobx.cjs.development.js +4 -1
- 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 +4 -1
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +4 -1
- 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.mjs +4 -1
- package/dist/mobx.mjs.map +1 -1
- package/dist/mobx.umd.development.js +4 -1
- 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/makeObservable.ts +0 -7
- package/src/core/computedvalue.ts +4 -1
- package/src/core/reaction.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# mobx
|
|
2
2
|
|
|
3
|
+
## 7.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7d85a68fb7e449650535aba22e47ce4d21bfbc10`](https://github.com/mobxjs/mobx/commit/7d85a68fb7e449650535aba22e47ce4d21bfbc10) [#4592](https://github.com/mobxjs/mobx/pull/4592) Thanks [@VimHax](https://github.com/VimHax)! - Extend IReactionDisposer with Disposable
|
|
8
|
+
|
|
9
|
+
- [`01211a698b64ea94de8e5f276ff8235fcf8ddf96`](https://github.com/mobxjs/mobx/commit/01211a698b64ea94de8e5f276ff8235fcf8ddf96) [#4700](https://github.com/mobxjs/mobx/pull/4700) Thanks [@kubk](https://github.com/kubk)! - Fix `onBecomeObserved` not firing for dependencies gained when an observed computed is recomputed inside an action.
|
|
10
|
+
|
|
11
|
+
- [`6e0a03ef74750b3040c76d3ecc14c4adf202b95a`](https://github.com/mobxjs/mobx/commit/6e0a03ef74750b3040c76d3ecc14c4adf202b95a) [#4710](https://github.com/mobxjs/mobx/pull/4710) Thanks [@kubk](https://github.com/kubk)! - Use TypeScript's built-in `NoInfer` utility instead of a local compatibility alias.
|
|
12
|
+
|
|
3
13
|
## 7.0.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { AnnotationsMap, CreateObservableOptions } from "../internal";
|
|
2
|
-
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
3
2
|
export declare function makeObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, annotations: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: CreateObservableOptions): T;
|
|
4
3
|
export declare function makeAutoObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, overrides?: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: CreateObservableOptions): T;
|
|
5
|
-
export {};
|
package/dist/core/reaction.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { $mobx, IDerivation, IDerivationState_, IObservable, Lambda, GenericAbor
|
|
|
20
20
|
export interface IReactionPublic {
|
|
21
21
|
dispose(): void;
|
|
22
22
|
}
|
|
23
|
-
export interface IReactionDisposer {
|
|
23
|
+
export interface IReactionDisposer extends Disposable {
|
|
24
24
|
(): void;
|
|
25
25
|
[$mobx]: Reaction;
|
|
26
26
|
}
|
|
@@ -1388,7 +1388,10 @@ class ComputedValue {
|
|
|
1388
1388
|
reportObserved(this);
|
|
1389
1389
|
if (shouldCompute(this)) {
|
|
1390
1390
|
let prevTrackingContext = globalState.trackingContext;
|
|
1391
|
-
if (this.keepAlive_
|
|
1391
|
+
if (!prevTrackingContext && (this.keepAlive_ || this.isBeingObserved)) {
|
|
1392
|
+
// An observed or keep-alive computed can be recomputed by an untracked
|
|
1393
|
+
// read, for example from inside an action. Its dependencies are still
|
|
1394
|
+
// transitively observed and must fire their lifecycle hooks
|
|
1392
1395
|
globalState.trackingContext = this;
|
|
1393
1396
|
}
|
|
1394
1397
|
if (this.trackAndCompute()) {
|