Skip to content

Commit 1727d2d

Browse files
committed
rename variable
1 parent 2a00b05 commit 1727d2d

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

lib/OnyxUtils.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const lastConnectionCallbackData = new Map<number, OnyxValue<OnyxKey>>();
7272

7373
let snapshotKey: OnyxKey | null = null;
7474

75-
let mergeAllPropsSnapshotKeys: string[] | undefined = [];
75+
let fullyMergedSnapshotKeys: string[] | undefined = [];
7676

7777
// Keeps track of the last subscriptionID that was used so we can keep incrementing it
7878
let lastSubscriptionID = 0;
@@ -87,8 +87,8 @@ function getSnapshotKey(): OnyxKey | null {
8787
return snapshotKey;
8888
}
8989

90-
function getMergeAllPropsSnapshotKeys(): string[] | undefined {
91-
return mergeAllPropsSnapshotKeys;
90+
function getFullyMergedSnapshotKeys(): string[] | undefined {
91+
return fullyMergedSnapshotKeys;
9292
}
9393

9494
/**
@@ -139,9 +139,9 @@ function setSkippableCollectionMemberIDs(ids: Set<string>): void {
139139
* @param keys - `ONYXKEYS` constants object from Onyx.init()
140140
* @param initialKeyStates - initial data to set when `init()` and `clear()` are called
141141
* @param evictableKeys - This is an array of keys (individual or collection patterns) that when provided to Onyx are flagged as "safe" for removal.
142-
* @param mergeAllSnapshotKeys - Array of collection keys whose backend returned data can be directly merged into snapshot without selectively picking the existing keys in the existing snapshot data.
142+
* @param fullyMergedSnapshotKeys - Array of collection keys whose backend returned data can be directly merged into snapshot without selectively picking the existing keys in the existing snapshot data.
143143
*/
144-
function initStoreValues(keys: DeepRecord<string, OnyxKey>, initialKeyStates: Partial<KeyValueMapping>, evictableKeys: OnyxKey[], mergeAllSnapshotKeys?: string[]): void {
144+
function initStoreValues(keys: DeepRecord<string, OnyxKey>, initialKeyStates: Partial<KeyValueMapping>, evictableKeys: OnyxKey[], fullyMergedSnapshotKeysParam?: string[]): void {
145145
// We need the value of the collection keys later for checking if a
146146
// key is a collection. We store it in a map for faster lookup.
147147
const collectionValues = Object.values(keys.COLLECTION ?? {}) as string[];
@@ -160,7 +160,7 @@ function initStoreValues(keys: DeepRecord<string, OnyxKey>, initialKeyStates: Pa
160160

161161
if (typeof keys.COLLECTION === 'object' && typeof keys.COLLECTION.SNAPSHOT === 'string') {
162162
snapshotKey = keys.COLLECTION.SNAPSHOT;
163-
mergeAllPropsSnapshotKeys = mergeAllSnapshotKeys;
163+
fullyMergedSnapshotKeys = fullyMergedSnapshotKeysParam;
164164
}
165165
}
166166

@@ -1425,9 +1425,9 @@ function updateSnapshots(data: OnyxUpdate[], mergeFn: typeof Onyx.merge): Array<
14251425
}
14261426

14271427
const oldValue = updatedData[key] || {};
1428-
const mergeAllSnapshotKeys = getMergeAllPropsSnapshotKeys();
1428+
const fullyMergedKeys = getFullyMergedSnapshotKeys();
14291429
const newValue =
1430-
mergeAllSnapshotKeys && mergeAllSnapshotKeys.some((collectionKey) => isCollectionMemberKey(collectionKey, key, collectionKey.length))
1430+
fullyMergedKeys && fullyMergedKeys.some((collectionKey) => isCollectionMemberKey(collectionKey, key, collectionKey.length))
14311431
? value
14321432
: lodashPick(value, Object.keys(snapshotData[key]));
14331433

@@ -1481,7 +1481,6 @@ const OnyxUtils = {
14811481
applyMerge,
14821482
initializeWithDefaultKeyStates,
14831483
getSnapshotKey,
1484-
getMergeAllPropsSnapshotKeys,
14851484
multiGet,
14861485
tupleGet,
14871486
isValidNonEmptyCollectionForMerge,

0 commit comments

Comments
 (0)