react-native-onyx 3.0.25 → 3.0.26

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 +0 -10
  2. package/package.json +1 -1
package/dist/useOnyx.js CHANGED
@@ -86,7 +86,6 @@ function useOnyx(key, options, dependencies = []) {
86
86
  const previousValueRef = (0, react_1.useRef)(null);
87
87
  // Stores the newest cached value in order to compare with the previous one and optimize `getSnapshot()` execution.
88
88
  const newValueRef = (0, react_1.useRef)(null);
89
- const lastConnectedKeyRef = (0, react_1.useRef)(key);
90
89
  // Stores the previously result returned by the hook, containing the data from cache and the fetch status.
91
90
  // We initialize it to `undefined` and `loading` fetch status to simulate the initial result when the hook is loading from the cache.
92
91
  // However, if `initWithStoredValues` is `false` we set the fetch status to `loaded` since we want to signal that data is ready.
@@ -115,15 +114,6 @@ function useOnyx(key, options, dependencies = []) {
115
114
  canBeMissing: options === null || options === void 0 ? void 0 : options.canBeMissing,
116
115
  }), [options === null || options === void 0 ? void 0 : options.selector, options === null || options === void 0 ? void 0 : options.initWithStoredValues, options === null || options === void 0 ? void 0 : options.allowStaleData, options === null || options === void 0 ? void 0 : options.canBeMissing]);
117
116
  (0, react_1.useEffect)(() => () => OnyxSnapshotCache_1.default.deregisterConsumer(key, cacheKey), [key, cacheKey]);
118
- (0, react_1.useEffect)(() => {
119
- if (lastConnectedKeyRef.current === key) {
120
- return;
121
- }
122
- lastConnectedKeyRef.current = key;
123
- shouldGetCachedValueRef.current = true;
124
- previousValueRef.current = null;
125
- resultRef.current = [undefined, { status: (options === null || options === void 0 ? void 0 : options.initWithStoredValues) === false ? 'loaded' : 'loading' }];
126
- }, [key, options === null || options === void 0 ? void 0 : options.initWithStoredValues]);
127
117
  (0, react_1.useEffect)(() => {
128
118
  // These conditions will ensure we can only handle dynamic collection member keys from the same collection.
129
119
  if ((options === null || options === void 0 ? void 0 : options.allowDynamicKey) || previousKey === key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "3.0.25",
3
+ "version": "3.0.26",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",