@goldfishjs/reactive-connect
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.4.2](https://github.com/alipay/goldfish/compare/v2.4.1...v2.4.2) (2022-03-01) | ||
### Bug Fixes | ||
* props sync ([64402c4](https://github.com/alipay/goldfish/commit/64402c4c978392e58e5ad58477c5d1c13a85a60b)) | ||
## [2.4.1](https://github.com/alipay/goldfish/compare/v2.4.0...v2.4.1) (2022-02-28) | ||
@@ -8,0 +19,0 @@ |
@@ -29,13 +29,22 @@ import _connect from "@goldfishjs/reactive/lib/connect"; | ||
function syncProps() { | ||
for (var key in this.props) { | ||
if (key in this.store.props) { | ||
this.store.props[key] = this.props[key]; | ||
function syncProps(lifeCycleName) { | ||
return function () { | ||
var nextProps = { | ||
onInit: this.props, | ||
didMount: this.props, | ||
deriveDataFromProps: arguments.length <= 0 ? undefined : arguments[0], | ||
didUpdate: this.props | ||
}[lifeCycleName]; | ||
for (var key in nextProps) { | ||
if (key in this.store.props) { | ||
this.store.props[key] = nextProps[key]; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
attachLogic(componentOptions, enterKey, 'after', syncProps); | ||
attachLogic(componentOptions, enterKey, 'after', syncProps(enterKey)); | ||
var refreshKey = isComponent2 ? 'deriveDataFromProps' : 'didUpdate'; | ||
attachLogic(componentOptions, refreshKey, 'after', syncProps); | ||
attachLogic(componentOptions, refreshKey, 'after', syncProps(refreshKey)); | ||
attachLogic(componentOptions, leaveKey, 'after', function () { | ||
@@ -42,0 +51,0 @@ this.store && (this.store.isSyncDataSafe = false); |
{ | ||
"name": "@goldfishjs/reactive-connect", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "goldfish-reactive-connect", | ||
@@ -17,5 +17,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@goldfishjs/module-usage": "^2.4.1", | ||
"@goldfishjs/reactive": "^2.4.1", | ||
"@goldfishjs/utils": "^2.4.1", | ||
"@goldfishjs/module-usage": "^2.4.2", | ||
"@goldfishjs/reactive": "^2.4.2", | ||
"@goldfishjs/utils": "^2.4.2", | ||
"mini-types": "^0.1.3" | ||
@@ -22,0 +22,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57987
1202
Updated@goldfishjs/reactive@^2.4.2
Updated@goldfishjs/utils@^2.4.2