Skip to content

Commit 0c80c84

Browse files
committed
Refactor subscribeToKey function in OnyxUtils to improve code clarity by removing unnecessary comments and unused code related to provisional mapping cleanup.
1 parent 7b5d5cd commit 0c80c84

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/OnyxUtils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,10 +1081,8 @@ function subscribeToKey<TKey extends OnyxKey>(connectOptions: ConnectOptions<TKe
10811081
if (skippableIDs.size) {
10821082
const [, collectionMemberID] = OnyxKeys.splitCollectionMemberKey(mapping.key);
10831083
if (skippableIDs.has(collectionMemberID)) {
1084-
// Clean up the provisional mapping to avoid retaining unused subscribers
1085-
// Mark this key as known-nullish and present in cache so hooks see a loaded undefined state
1084+
// Clean up the provisional mapping to avoid retaining unused subscribers.
10861085
cache.addNullishStorageKey(mapping.key);
1087-
cache.set(mapping.key, undefined as OnyxValue<TKey>);
10881086
delete callbackToStateMapping[subscriptionID];
10891087
return subscriptionID;
10901088
}

0 commit comments

Comments
 (0)