react-native-onyx 2.0.55 → 2.0.56
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/useOnyx.js +3 -4
- package/package.json +1 -1
package/dist/useOnyx.js
CHANGED
|
@@ -86,12 +86,11 @@ function useOnyx(key, options) {
|
|
|
86
86
|
newValueRef.current = ((_a = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _a !== void 0 ? _a : undefined);
|
|
87
87
|
newFetchStatus = 'loaded';
|
|
88
88
|
}
|
|
89
|
-
// We do a deep equality check if
|
|
90
|
-
//
|
|
91
|
-
// all of them created using the `selector` function.
|
|
89
|
+
// We do a deep equality check if `selector` is defined, since each `OnyxUtils.tryGetCachedValue()` call will
|
|
90
|
+
// generate a plain new primitive/object/array that was created using the `selector` function.
|
|
92
91
|
// For the other cases we will only deal with object reference checks, so just a shallow equality check is enough.
|
|
93
92
|
let areValuesEqual;
|
|
94
|
-
if (
|
|
93
|
+
if (selectorRef.current) {
|
|
95
94
|
areValuesEqual = (0, fast_equals_1.deepEqual)((_b = previousValueRef.current) !== null && _b !== void 0 ? _b : undefined, newValueRef.current);
|
|
96
95
|
}
|
|
97
96
|
else {
|