mobx 6.3.12 → 6.3.13
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 +11 -4
- 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 +11 -4
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +11 -4
- 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 +11 -4
- 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/flowannotation.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# mobx
|
|
2
2
|
|
|
3
|
+
## 6.3.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`23803202`](https://github.com/mobxjs/mobx/commit/2380320263f5edcd06d7ba6bdf02aff3fd7d305a) [#3273](https://github.com/mobxjs/mobx/pull/3273) Thanks [@urugator](https://github.com/urugator)! - fix `flow.bound` #3271
|
|
8
|
+
|
|
3
9
|
## 6.3.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -735,7 +735,7 @@ function make_$2(adm, key, descriptor, source) {
|
|
|
735
735
|
// bound - must annotate protos to support super.flow()
|
|
736
736
|
|
|
737
737
|
|
|
738
|
-
if ((_this$options_ = this.options_) != null && _this$options_.bound && !isFlow(adm.target_[key])) {
|
|
738
|
+
if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {
|
|
739
739
|
if (this.extend_(adm, key, descriptor, false) === null) return 0
|
|
740
740
|
/* Cancel */
|
|
741
741
|
;
|
|
@@ -779,16 +779,23 @@ safeDescriptors) {
|
|
|
779
779
|
}
|
|
780
780
|
|
|
781
781
|
assertFlowDescriptor(adm, annotation, key, descriptor);
|
|
782
|
-
var value = descriptor.value;
|
|
782
|
+
var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype
|
|
783
|
+
|
|
784
|
+
if (!isFlow(value)) {
|
|
785
|
+
value = flow(value);
|
|
786
|
+
}
|
|
783
787
|
|
|
784
788
|
if (bound) {
|
|
785
789
|
var _adm$proxy_;
|
|
786
790
|
|
|
787
|
-
|
|
791
|
+
// We do not keep original function around, so we bind the existing flow
|
|
792
|
+
value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...
|
|
793
|
+
|
|
794
|
+
value.isMobXFlow = true;
|
|
788
795
|
}
|
|
789
796
|
|
|
790
797
|
return {
|
|
791
|
-
value:
|
|
798
|
+
value: value,
|
|
792
799
|
// Non-configurable for classes
|
|
793
800
|
// prevents accidental field redefinition in subclass
|
|
794
801
|
configurable: safeDescriptors ? adm.isPlainObject_ : true,
|