Skip to content

Commit 65a0b98

Browse files
committed
More cleanup!
1 parent e79f794 commit 65a0b98

File tree

7 files changed

+5
-11
lines changed

7 files changed

+5
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* custom atoms: `reportObserved` outside tracking context won't trigger changes
3030
* map `.entries()`, `.values()` and `.keys()` now properly return iterators. use `values(m)` or `keys(m)` or `Array.from(m)` to get the old behavior
3131
* the option `struct` for computed values is deprecated, use `compareStructural` indeed
32+
* `isModifierDescriptor` is no longer exposed
3233

3334
## Non breaking changes
3435

src/api/object-api.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77
} from "../types/observableobject"
88
import { isObservableArray, IObservableArray } from "../types/observablearray"
99
import { fail, invariant } from "../utils/utils"
10-
import { isModifierDescriptor } from "../mobx"
11-
import { deepEnhancer } from "../types/modifiers"
10+
import { deepEnhancer, isModifierDescriptor } from "../types/modifiers"
1211
import { startBatch, endBatch } from "../core/observable"
1312

1413
export function keys(obj: IObservableObject): string[]

src/core/action.ts

-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ export function useStrict(strict: boolean): void {
8383
globalState.allowStateChanges = !strict
8484
}
8585

86-
export function isStrictModeEnabled(): boolean {
87-
return globalState.strictMode
88-
}
89-
9086
export function allowStateChanges<T>(allowStateChanges: boolean, func: () => T): T {
9187
const prev = allowStateChangesStart(allowStateChanges)
9288
let res: T

src/mobx.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export { spy } from "./core/spy"
2525
export { IComputedValue } from "./core/computedvalue"
2626

2727
export { IEqualsComparer, comparer } from "./types/comparer"
28-
export { IModifierDescriptor, IEnhancer, isModifierDescriptor } from "./types/modifiers"
28+
export { IModifierDescriptor, IEnhancer } from "./types/modifiers"
2929
export { IInterceptable, IInterceptor } from "./types/intercept-utils"
3030
export { IListenable } from "./types/listen-utils"
3131

test/base/api.js

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ test("correct api should be exposed", function() {
2828
"isComputed",
2929
"isComputedProp",
3030
"_isComputingDerivation",
31-
"isModifierDescriptor", // TODO: drop
3231
"isObservable",
3332
"isObservableArray",
3433
"isObservableMap",

test/base/observables.js

-1
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,6 @@ test("atom events #427", () => {
13541354
var runs = 0
13551355

13561356
var a = mobx.createAtom("test", () => start++, () => stop++)
1357-
// TODO: fix: Atom should throw on this! (or have a handler to react to untracked reads)
13581357
expect(a.reportObserved()).toEqual(false)
13591358

13601359
expect(start).toBe(0)

test/base/typescript-tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,8 @@ test("803 - action.bound and action preserve type info", () => {
11511151

11521152
thingThatAcceptsCallback(
11531153
action((elem: any) => {
1154-
// TODO: ideally, type of action would be inferred!
1155-
// console.log(elem.x) // x is boolean
1154+
// ideally, type of action would be inferred!
1155+
console.log(elem.x) // x is boolean
11561156
})
11571157
)
11581158

0 commit comments

Comments
 (0)