mobx 6.13.2 → 6.13.3
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/dist/mobx.cjs.development.js +12 -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 +12 -5
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +12 -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 +12 -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/package.json +1 -1
- package/src/types/actionannotation.ts +12 -7
package/package.json
CHANGED
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
Annotation,
|
|
9
9
|
globalState,
|
|
10
10
|
MakeResult,
|
|
11
|
-
assert20223DecoratorType
|
|
12
|
-
storeAnnotation
|
|
11
|
+
assert20223DecoratorType
|
|
13
12
|
} from "../internal"
|
|
14
13
|
|
|
15
14
|
export function createActionAnnotation(name: string, options?: object): Annotation {
|
|
@@ -73,12 +72,18 @@ function decorate_20223_(this: Annotation, mthd, context: DecoratorContext) {
|
|
|
73
72
|
const _createAction = m =>
|
|
74
73
|
createAction(ann.options_?.name ?? name!.toString(), m, ann.options_?.autoAction ?? false)
|
|
75
74
|
|
|
76
|
-
// Backwards/Legacy behavior, expects makeObservable(this)
|
|
77
75
|
if (kind == "field") {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
return function (initMthd) {
|
|
77
|
+
let mthd = initMthd
|
|
78
|
+
if (!isAction(mthd)) {
|
|
79
|
+
mthd = _createAction(mthd)
|
|
80
|
+
}
|
|
81
|
+
if (ann.options_?.bound) {
|
|
82
|
+
mthd = mthd.bind(this)
|
|
83
|
+
mthd.isMobxAction = true
|
|
84
|
+
}
|
|
85
|
+
return mthd
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
if (kind == "method") {
|