Skip to content

Commit 2ab4c73

Browse files
cabljacyunseop-dev
andauthored
Update packages/database/src/useDatabaseSnapshot.ts
Co-authored-by: 김윤섭 <[email protected]>
1 parent 3c4dfdb commit 2ab4c73

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/database/src/useDatabaseSnapshot.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ export function useDatabaseValue<T = unknown | null, R = T>(
7272
[ref]
7373
);
7474

75-
return useSubscription<T, Error, R>(
75+
return useSubscription<T, Error, R>(
7676
queryKey,
77-
["useFirestoreDatabase", ref.key],
77+
['useDatabaseValue', queryKey],
7878
subscribeFn,
79-
useQueryOptions,
80-
!isSubscription,
81-
async () => parseDataSnapshot(await get(ref), !!options?.toArray)
79+
{
80+
...useQueryOptions,
81+
onlyOnce: !isSubscription,
82+
fetchFn: async () => parseDataSnapshot(await get(ref), !!options?.toArray),
83+
},
8284
);
8385
}

0 commit comments

Comments
 (0)