react-native-onyx 2.0.61 → 2.0.62
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 +6 -1
- package/package.json +1 -1
package/dist/OnyxUtils.js
CHANGED
|
@@ -653,6 +653,7 @@ function keyChanged(key, value, previousValue, canUpdateSubscriber = () => true,
|
|
|
653
653
|
return;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
+
const cachedCollections = {};
|
|
656
657
|
for (let i = 0; i < stateMappingKeys.length; i++) {
|
|
657
658
|
const subscriber = callbackToStateMapping[stateMappingKeys[i]];
|
|
658
659
|
if (!subscriber || !isKeyMatch(subscriber.key, key) || !canUpdateSubscriber(subscriber)) {
|
|
@@ -667,7 +668,11 @@ function keyChanged(key, value, previousValue, canUpdateSubscriber = () => true,
|
|
|
667
668
|
continue;
|
|
668
669
|
}
|
|
669
670
|
if (isCollectionKey(subscriber.key) && subscriber.waitForCollectionCallback) {
|
|
670
|
-
|
|
671
|
+
let cachedCollection = cachedCollections[subscriber.key];
|
|
672
|
+
if (!cachedCollection) {
|
|
673
|
+
cachedCollection = getCachedCollection(subscriber.key);
|
|
674
|
+
cachedCollections[subscriber.key] = cachedCollection;
|
|
675
|
+
}
|
|
671
676
|
cachedCollection[key] = value;
|
|
672
677
|
subscriber.callback(cachedCollection);
|
|
673
678
|
continue;
|