react-native-onyx 3.0.103 → 3.0.104

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/OnyxCache.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TASK = void 0;
7
7
  const fast_equals_1 = require("fast-equals");
8
- const bindAll_1 = __importDefault(require("lodash/bindAll"));
8
+ const lodash_bindall_1 = __importDefault(require("lodash.bindall"));
9
9
  const utils_1 = __importDefault(require("./utils"));
10
10
  const OnyxKeys_1 = __importDefault(require("./OnyxKeys"));
11
11
  /**
@@ -47,7 +47,7 @@ class OnyxCache {
47
47
  this.collectionSnapshots = new Map();
48
48
  this.dirtyCollections = new Set();
49
49
  // bind all public methods to prevent problems with `this`
50
- (0, bindAll_1.default)(this, 'getAllKeys', 'get', 'hasCacheForKey', 'addKey', 'addNullishStorageKey', 'hasNullishStorageKey', 'clearNullishStorageKeys', 'set', 'drop', 'merge', 'hydrate', 'hasPendingTask', 'getTaskPromise', 'captureTask', 'setAllKeys', 'setEvictionAllowList', 'isEvictableKey', 'removeLastAccessedKey', 'addLastAccessedKey', 'addEvictableKeysToRecentlyAccessedList', 'getKeyForEviction', 'setCollectionKeys', 'hasValueChanged', 'getCollectionData');
50
+ (0, lodash_bindall_1.default)(this, 'getAllKeys', 'get', 'hasCacheForKey', 'addKey', 'addNullishStorageKey', 'hasNullishStorageKey', 'clearNullishStorageKeys', 'set', 'drop', 'merge', 'hydrate', 'hasPendingTask', 'getTaskPromise', 'captureTask', 'setAllKeys', 'setEvictionAllowList', 'isEvictableKey', 'removeLastAccessedKey', 'addLastAccessedKey', 'addEvictableKeysToRecentlyAccessedList', 'getKeyForEviction', 'setCollectionKeys', 'hasValueChanged', 'getCollectionData');
51
51
  }
52
52
  /** Get all the storage keys */
53
53
  getAllKeys() {
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- const bindAll_1 = __importDefault(require("lodash/bindAll"));
39
+ const lodash_bindall_1 = __importDefault(require("lodash.bindall"));
40
40
  const Logger = __importStar(require("./Logger"));
41
41
  const OnyxUtils_1 = __importDefault(require("./OnyxUtils"));
42
42
  const OnyxKeys_1 = __importDefault(require("./OnyxKeys"));
@@ -51,7 +51,7 @@ class OnyxConnectionManager {
51
51
  this.lastCallbackID = 0;
52
52
  this.sessionID = Str.guid();
53
53
  // Binds all public methods to prevent problems with `this`.
54
- (0, bindAll_1.default)(this, 'generateConnectionID', 'fireCallbacks', 'connect', 'disconnect', 'disconnectAll', 'refreshSessionID');
54
+ (0, lodash_bindall_1.default)(this, 'generateConnectionID', 'fireCallbacks', 'connect', 'disconnect', 'disconnectAll', 'refreshSessionID');
55
55
  }
56
56
  /**
57
57
  * Generates a connection ID based on the `connectOptions` object passed to the function.
@@ -1,16 +1,17 @@
1
+ declare function NOOP(..._args: unknown[]): void;
1
2
  /**
2
3
  * This is used to keep multiple browser tabs in sync, therefore only needed on web
3
4
  * On native platforms, we omit this syncing logic by setting this to mock implementation.
4
5
  */
5
6
  declare const InstanceSync: {
6
7
  shouldBeUsed: boolean;
7
- init: (...args: any[]) => void;
8
- setItem: (...args: any[]) => void;
9
- removeItem: (...args: any[]) => void;
10
- removeItems: (...args: any[]) => void;
11
- multiMerge: (...args: any[]) => void;
12
- multiSet: (...args: any[]) => void;
13
- mergeItem: (...args: any[]) => void;
8
+ init: typeof NOOP;
9
+ setItem: typeof NOOP;
10
+ removeItem: typeof NOOP;
11
+ removeItems: typeof NOOP;
12
+ multiMerge: typeof NOOP;
13
+ multiSet: typeof NOOP;
14
+ mergeItem: typeof NOOP;
14
15
  clear: <T extends () => void>(callback: T) => Promise<void>;
15
16
  };
16
17
  export default InstanceSync;
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const noop_1 = __importDefault(require("lodash/noop"));
3
+ function NOOP(..._args) {
4
+ // Native InstanceSync is a no-op; web implements real cross-tab sync.
5
+ }
7
6
  /**
8
7
  * This is used to keep multiple browser tabs in sync, therefore only needed on web
9
8
  * On native platforms, we omit this syncing logic by setting this to mock implementation.
10
9
  */
11
10
  const InstanceSync = {
12
11
  shouldBeUsed: false,
13
- init: noop_1.default,
14
- setItem: noop_1.default,
15
- removeItem: noop_1.default,
16
- removeItems: noop_1.default,
17
- multiMerge: noop_1.default,
18
- multiSet: noop_1.default,
19
- mergeItem: noop_1.default,
12
+ init: NOOP,
13
+ setItem: NOOP,
14
+ removeItem: NOOP,
15
+ removeItems: NOOP,
16
+ multiMerge: NOOP,
17
+ multiSet: NOOP,
18
+ mergeItem: NOOP,
20
19
  clear: (callback) => Promise.resolve(callback()),
21
20
  };
22
21
  exports.default = InstanceSync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "3.0.103",
3
+ "version": "3.0.104",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",
@@ -65,6 +65,7 @@
65
65
  "@types/jest": "^29.5.14",
66
66
  "@types/jsdoc-to-markdown": "^7.0.6",
67
67
  "@types/lodash": "^4.14.202",
68
+ "@types/lodash.bindall": "^4.4.9",
68
69
  "@types/node": "^20.11.5",
69
70
  "@types/react": "^18.2.14",
70
71
  "@types/react-native": "^0.70.0",