react-native-onyx 1.0.69 → 1.0.71

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.
@@ -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
- // Keeps a copy of the values of the onyx collection keys as a map for faster lookups
113
- let onyxCollectionKeyMap = {};
112
+ // Stores all of the keys that Onyx can use. Must be defined in init().
113
+ let onyxKeys = {};
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 onyxCollectionKeyMap.has(key);
226
+ return underscore__WEBPACK_IMPORTED_MODULE_1___default().contains(underscore__WEBPACK_IMPORTED_MODULE_1___default().values(onyxKeys.COLLECTION), key);
227
227
  }
228
228
 
229
229
  /**
@@ -1474,13 +1474,8 @@ function init()
1474
1474
  _OnyxCache__WEBPACK_IMPORTED_MODULE_3__["default"].setRecentKeysLimit(maxCachedKeysCount);
1475
1475
  }
1476
1476
 
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());
1477
+ // Let Onyx know about all of our keys
1478
+ onyxKeys = keys;
1484
1479
 
1485
1480
  // Set our default key states to use when initializing and clearing Onyx data
1486
1481
  defaultKeyStates = initialKeyStates;