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.
Files changed (2) hide show
  1. package/dist/useOnyx.js +3 -4
  2. 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 we are subscribed to a collection key and `selector` is defined,
90
- // since each `OnyxUtils.tryGetCachedValue()` call will generate a plain new collection object with new records as well,
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 (OnyxUtils_1.default.isCollectionKey(key) && selectorRef.current) {
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "2.0.55",
3
+ "version": "2.0.56",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",