react-native-onyx 2.0.37 → 2.0.38
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 +12 -9
- package/package.json +1 -1
package/dist/OnyxUtils.js
CHANGED
|
@@ -324,16 +324,19 @@ function addAllSafeEvictionKeysToRecentlyAccessedList() {
|
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
function getCachedCollection(collectionKey, collectionMemberKeys) {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
327
|
+
const allKeys = collectionMemberKeys || OnyxCache_1.default.getAllKeys();
|
|
328
|
+
const collection = {};
|
|
329
|
+
// forEach exists on both Set and Array
|
|
330
|
+
allKeys.forEach((key) => {
|
|
331
|
+
// If we don't have collectionMemberKeys array then we have to check whether a key is a collection member key.
|
|
332
|
+
// Because in that case the keys will be coming from `cache.getAllKeys()` and we need to filter out the keys that
|
|
333
|
+
// are not part of the collection.
|
|
334
|
+
if (!collectionMemberKeys && !isCollectionMemberKey(collectionKey, key)) {
|
|
335
|
+
return;
|
|
332
336
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}, {});
|
|
337
|
+
collection[key] = OnyxCache_1.default.getValue(key);
|
|
338
|
+
});
|
|
339
|
+
return collection;
|
|
337
340
|
}
|
|
338
341
|
/**
|
|
339
342
|
* When a collection of keys change, search for any callbacks matching the collection key and trigger those callbacks
|