Skip to content

Commit 4c64fa2

Browse files
committed
Add comments
1 parent 1f4e5d6 commit 4c64fa2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/auth/index.rn.ts

+9
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,20 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
7171
return provider.getImmediate();
7272
}
7373

74+
// Only warn if getAuth() is called before initializeAuth()
7475
_logWarn(NO_PERSISTENCE_WARNING);
7576

7677
return initializeAuthOriginal(app);
7778
}
7879

80+
/**
81+
* Wrapper around base `initializeAuth()` for RN users only, which
82+
* shows the warning message if no persistence is provided.
83+
* Double-checked potential collision with `export * from './index.shared'`
84+
* as `./index.shared` also exports `initializeAuth()`, and the final
85+
* bundle does correctly export only this `initializeAuth()` function
86+
* and not the one from index.shared.
87+
*/
7988
export function initializeAuth(app: FirebaseApp, deps?: Dependencies): Auth {
8089
if (!deps?.persistence) {
8190
_logWarn(NO_PERSISTENCE_WARNING);

0 commit comments

Comments
 (0)