react-native-onyx 1.0.114 → 1.0.115
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/dist/web.development.js +3 -7
- package/dist/web.development.js.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/lib/withOnyx.js +3 -7
- package/package.json +1 -1
package/dist/web.development.js
CHANGED
|
@@ -2589,7 +2589,7 @@ function _extends() {_extends = Object.assign ? Object.assign.bind() : function
|
|
|
2589
2589
|
|
|
2590
2590
|
// This is a list of keys that can exist on a `mapping`, but are not directly related to loading data from Onyx. When the keys of a mapping are looped over to check
|
|
2591
2591
|
// if a key has changed, it's a good idea to skip looking at these properties since they would have unexpected results.
|
|
2592
|
-
const mappingPropertiesToIgnoreChangesTo = ['initialValue'];
|
|
2592
|
+
const mappingPropertiesToIgnoreChangesTo = ['initialValue', 'allowStaleData'];
|
|
2593
2593
|
|
|
2594
2594
|
/**
|
|
2595
2595
|
* Returns the display name of a component
|
|
@@ -2696,12 +2696,9 @@ const getOnyxDataFromState = (state, onyxToStateMapping) => underscore__WEBPACK_
|
|
|
2696
2696
|
const onyxDataFromState = getOnyxDataFromState(this.state, mapOnyxToState);
|
|
2697
2697
|
const prevOnyxDataFromState = getOnyxDataFromState(prevState, mapOnyxToState);
|
|
2698
2698
|
|
|
2699
|
-
// This ensures that only one property is reconnecting at a time, or else it can lead to race conditions and infinite rendering loops. No fun!
|
|
2700
|
-
let isReconnectingToOnyx = false;
|
|
2701
|
-
|
|
2702
2699
|
underscore__WEBPACK_IMPORTED_MODULE_2___default().each(mapOnyxToState, (mapping, propName) => {
|
|
2703
|
-
// Some properties can be ignored
|
|
2704
|
-
if (underscore__WEBPACK_IMPORTED_MODULE_2___default().includes(mappingPropertiesToIgnoreChangesTo, propName)
|
|
2700
|
+
// Some properties can be ignored because they aren't related to onyx keys and they will never change
|
|
2701
|
+
if (underscore__WEBPACK_IMPORTED_MODULE_2___default().includes(mappingPropertiesToIgnoreChangesTo, propName)) {
|
|
2705
2702
|
return;
|
|
2706
2703
|
}
|
|
2707
2704
|
|
|
@@ -2717,7 +2714,6 @@ const getOnyxDataFromState = (state, onyxToStateMapping) => underscore__WEBPACK_
|
|
|
2717
2714
|
_Str__WEBPACK_IMPORTED_MODULE_3__.result(mapping.key, { ...prevProps, ...prevOnyxDataFromState });
|
|
2718
2715
|
const newKey = _Str__WEBPACK_IMPORTED_MODULE_3__.result(mapping.key, { ...this.props, ...onyxDataFromState });
|
|
2719
2716
|
if (previousKey !== newKey) {
|
|
2720
|
-
isReconnectingToOnyx = true;
|
|
2721
2717
|
_Onyx__WEBPACK_IMPORTED_MODULE_4__["default"].disconnect(this.activeConnectionIDs[previousKey], previousKey);
|
|
2722
2718
|
delete this.activeConnectionIDs[previousKey];
|
|
2723
2719
|
this.connectMappingToOnyx(mapping, propName, newKey);
|