react-native-onyx 1.0.68 → 1.0.70
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 +8 -10
- 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.js +5 -10
- package/lib/storage/providers/IDBKeyVal.js +3 -0
- package/package.json +1 -1
package/lib/Onyx.js
CHANGED
|
@@ -27,8 +27,8 @@ let lastConnectionID = 0;
|
|
|
27
27
|
// Holds a mapping of all the react components that want their state subscribed to a store key
|
|
28
28
|
const callbackToStateMapping = {};
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
let
|
|
30
|
+
// Stores all of the keys that Onyx can use. Must be defined in init().
|
|
31
|
+
let onyxKeys = {};
|
|
32
32
|
|
|
33
33
|
// Holds a list of keys that have been directly subscribed to or recently modified from least to most recent
|
|
34
34
|
let recentlyAccessedKeys = [];
|
|
@@ -141,7 +141,7 @@ function getAllKeys() {
|
|
|
141
141
|
* @returns {Boolean}
|
|
142
142
|
*/
|
|
143
143
|
function isCollectionKey(key) {
|
|
144
|
-
return
|
|
144
|
+
return _.contains(_.values(onyxKeys.COLLECTION), key);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -1392,13 +1392,8 @@ function init({
|
|
|
1392
1392
|
cache.setRecentKeysLimit(maxCachedKeysCount);
|
|
1393
1393
|
}
|
|
1394
1394
|
|
|
1395
|
-
//
|
|
1396
|
-
|
|
1397
|
-
const collectionValues = _.values(keys.COLLECTION);
|
|
1398
|
-
onyxCollectionKeyMap = _.reduce(collectionValues, (acc, val) => {
|
|
1399
|
-
acc.set(val, true);
|
|
1400
|
-
return acc;
|
|
1401
|
-
}, new Map());
|
|
1395
|
+
// Let Onyx know about all of our keys
|
|
1396
|
+
onyxKeys = keys;
|
|
1402
1397
|
|
|
1403
1398
|
// Set our default key states to use when initializing and clearing Onyx data
|
|
1404
1399
|
defaultKeyStates = initialKeyStates;
|
|
@@ -86,6 +86,9 @@ const provider = {
|
|
|
86
86
|
*/
|
|
87
87
|
clear: () => clear(getCustomStore()),
|
|
88
88
|
|
|
89
|
+
// This is a noop for now in order to keep clients from crashing see https://github.com/Expensify/Expensify/issues/312438
|
|
90
|
+
setMemoryOnlyKeys: () => {},
|
|
91
|
+
|
|
89
92
|
/**
|
|
90
93
|
* Returns all keys available in storage
|
|
91
94
|
* @returns {Promise<String[]>}
|