react-native-onyx 1.0.32 → 1.0.33
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 +7 -4
- 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 -4
- package/lib/OnyxCache.js +2 -0
- package/package.json +1 -1
package/lib/Onyx.js
CHANGED
|
@@ -799,8 +799,7 @@ function notifyCollectionSubscribersOnNextTick(key, value) {
|
|
|
799
799
|
* @return {Promise}
|
|
800
800
|
*/
|
|
801
801
|
function remove(key) {
|
|
802
|
-
|
|
803
|
-
cache.set(key, null);
|
|
802
|
+
cache.drop(key);
|
|
804
803
|
notifySubscribersOnNextTick(key, null);
|
|
805
804
|
return Storage.removeItem(key);
|
|
806
805
|
}
|
|
@@ -847,8 +846,9 @@ function evictStorageAndRetry(error, onyxMethod, ...args) {
|
|
|
847
846
|
* @returns {Promise}
|
|
848
847
|
*/
|
|
849
848
|
function set(key, value) {
|
|
850
|
-
|
|
851
|
-
|
|
849
|
+
if (_.isNull(value)) {
|
|
850
|
+
return remove(key);
|
|
851
|
+
}
|
|
852
852
|
|
|
853
853
|
// eslint-disable-next-line no-use-before-define
|
|
854
854
|
if (hasPendingMergeForKey(key)) {
|
|
@@ -1294,6 +1294,7 @@ const Onyx = {
|
|
|
1294
1294
|
mergeCollection,
|
|
1295
1295
|
update,
|
|
1296
1296
|
clear,
|
|
1297
|
+
getAllKeys,
|
|
1297
1298
|
init,
|
|
1298
1299
|
registerLogger: Logger.registerLogger,
|
|
1299
1300
|
addToEvictionBlockList,
|
package/lib/OnyxCache.js
CHANGED