react-native-onyx 3.0.27 → 3.0.28
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/OnyxUtils.js +3 -2
- package/package.json +1 -1
package/dist/OnyxUtils.js
CHANGED
|
@@ -699,7 +699,7 @@ function addKeyToRecentlyAccessedIfNeeded(key) {
|
|
|
699
699
|
function getCollectionDataAndSendAsObject(matchingKeys, mapping) {
|
|
700
700
|
multiGet(matchingKeys).then((dataMap) => {
|
|
701
701
|
const data = Object.fromEntries(dataMap.entries());
|
|
702
|
-
sendDataToConnection(mapping, data,
|
|
702
|
+
sendDataToConnection(mapping, data, mapping.key);
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
705
|
/**
|
|
@@ -961,9 +961,10 @@ function subscribeToKey(connectOptions) {
|
|
|
961
961
|
if (mapping.key) {
|
|
962
962
|
OnyxCache_1.default.addNullishStorageKey(mapping.key);
|
|
963
963
|
}
|
|
964
|
+
const matchedKey = isCollectionKey(mapping.key) && mapping.waitForCollectionCallback ? mapping.key : undefined;
|
|
964
965
|
// Here we cannot use batching because the nullish value is expected to be set immediately for default props
|
|
965
966
|
// or they will be undefined.
|
|
966
|
-
sendDataToConnection(mapping, null,
|
|
967
|
+
sendDataToConnection(mapping, null, matchedKey);
|
|
967
968
|
return;
|
|
968
969
|
}
|
|
969
970
|
// When using a callback subscriber we will either trigger the provided callback for each key we find or combine all values
|