Skip to content

Commit 6d27c83

Browse files
committed
Add optional database parameter to useFirestore function
1 parent 822a10c commit 6d27c83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/firestore/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ export function useDocument<T>(
107107
* Retrieves the Firestore instance.
108108
*
109109
* @param name - name of the application
110+
* @param database - name of the database
110111
* @returns the Firestore instance
111112
*/
112-
export function useFirestore(name?: string) {
113-
return getFirestore(useFirebaseApp(name))
113+
export function useFirestore({name, database}: {name?: string, database?: string}) {
114+
return getFirestore(useFirebaseApp(name), database)
114115
}

0 commit comments

Comments
 (0)