react-native-onyx 1.0.65 → 1.0.67
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 +10 -5
- 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/Onyx.d.ts +2 -2
- package/lib/Onyx.js +10 -5
- package/package.json +1 -1
package/dist/web.development.js
CHANGED
|
@@ -109,8 +109,8 @@ let lastConnectionID = 0;
|
|
|
109
109
|
// Holds a mapping of all the react components that want their state subscribed to a store key
|
|
110
110
|
const callbackToStateMapping = {};
|
|
111
111
|
|
|
112
|
-
//
|
|
113
|
-
let
|
|
112
|
+
// Keeps a copy of the values of the onyx collection keys as a map for faster lookups
|
|
113
|
+
let onyxCollectionKeyMap = {};
|
|
114
114
|
|
|
115
115
|
// Holds a list of keys that have been directly subscribed to or recently modified from least to most recent
|
|
116
116
|
let recentlyAccessedKeys = [];
|
|
@@ -223,7 +223,7 @@ function getAllKeys() {
|
|
|
223
223
|
* @returns {Boolean}
|
|
224
224
|
*/
|
|
225
225
|
function isCollectionKey(key) {
|
|
226
|
-
return
|
|
226
|
+
return onyxCollectionKeyMap.has(key);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
@@ -1474,8 +1474,13 @@ function init()
|
|
|
1474
1474
|
_OnyxCache__WEBPACK_IMPORTED_MODULE_3__["default"].setRecentKeysLimit(maxCachedKeysCount);
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
//
|
|
1478
|
-
|
|
1477
|
+
// We need the value of the collection keys later for checking if a
|
|
1478
|
+
// key is a collection. We store it in a map for faster lookup.
|
|
1479
|
+
const collectionValues = underscore__WEBPACK_IMPORTED_MODULE_1___default().values(keys.COLLECTION);
|
|
1480
|
+
onyxCollectionKeyMap = underscore__WEBPACK_IMPORTED_MODULE_1___default().reduce(collectionValues, (acc, val) => {
|
|
1481
|
+
acc.set(val, true);
|
|
1482
|
+
return acc;
|
|
1483
|
+
}, new Map());
|
|
1479
1484
|
|
|
1480
1485
|
// Set our default key states to use when initializing and clearing Onyx data
|
|
1481
1486
|
defaultKeyStates = initialKeyStates;
|