Skip to content

Commit a54b132

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

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
@@ -23,13 +23,15 @@ export function useDatabaseSnapshot<R = DataSnapshot>(
2323
[ref]
2424
);
2525

26-
return useSubscription<DataSnapshot, Error, R>(
26+
return useSubscription<DataSnapshot, Error, R>(
2727
queryKey,
28-
["useFirestoreDatabase", ref.key],
28+
['useDatabaseSnapshot', queryKey],
2929
subscribeFn,
30-
useQueryOptions,
31-
!isSubscription,
32-
async () => get(ref)
30+
{
31+
...useQueryOptions,
32+
onlyOnce: !isSubscription,
33+
fetchFn: async () => get(ref),
34+
},
3335
);
3436
}
3537

0 commit comments

Comments
 (0)