Skip to content

Commit cb47923

Browse files
committed
update comments
1 parent 06f63ea commit cb47923

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/useOnyx.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ function useOnyx<TKey extends OnyxKey, TReturnValue = OnyxValue<TKey>>(
163163

164164
useEffect(() => () => onyxSnapshotCache.deregisterConsumer(key, cacheKey), [key, cacheKey]);
165165

166-
// Precompute whether this key is a skippable collection member so that getSnapshot()
167-
// can use a cheap boolean check instead of calling splitCollectionMemberKey on every render.
166+
// Precompute whether this key is a skippable collection member key.
168167
const isSkippableKey = useMemo(() => {
169168
const skippableIDs = OnyxUtils.getSkippableCollectionMemberIDs();
170169
if (!skippableIDs.size) {
@@ -247,7 +246,6 @@ function useOnyx<TKey extends OnyxKey, TReturnValue = OnyxValue<TKey>>(
247246

248247
const getSnapshot = useCallback(() => {
249248
// Fast path: if subscribing to a skippable collection member id, return undefined as loaded immediately.
250-
// The `isSkippableKey` flag is precomputed so we avoid calling splitCollectionMemberKey here.
251249
if (isFirstConnectionRef.current && isSkippableKey) {
252250
if (resultRef.current[1].status !== 'loaded' || resultRef.current[0] !== undefined) {
253251
resultRef.current = [undefined, {status: 'loaded'}];

0 commit comments

Comments
 (0)