react-native-onyx 3.0.68 → 3.0.69
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 +5 -0
- package/package.json +1 -1
package/dist/OnyxUtils.js
CHANGED
|
@@ -231,6 +231,11 @@ function get(key) {
|
|
|
231
231
|
// The key is not a collection one or something went wrong during split, so we proceed with the function's logic.
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
+
// Prefer cache over stale storage if a concurrent write populated it during the read.
|
|
235
|
+
const cachedValue = OnyxCache_1.default.get(key);
|
|
236
|
+
if (cachedValue !== undefined) {
|
|
237
|
+
return cachedValue;
|
|
238
|
+
}
|
|
234
239
|
if (val === undefined) {
|
|
235
240
|
OnyxCache_1.default.addNullishStorageKey(key);
|
|
236
241
|
return undefined;
|