File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,25 @@ import { AuthUserInjectSymbol, setupOnAuthStateChanged } from './user'
7
7
8
8
export { setupOnAuthStateChanged , useCurrentUser } from './user'
9
9
10
+ /**
11
+ * VueFire Auth Module to be added to the `VueFire` Vue plugin options.
12
+ *
13
+ * @example
14
+ *
15
+ * ```ts
16
+ * import { createApp } from 'vue'
17
+ * import { VueFire, VueFireAuth } from 'vuefire'
18
+ *
19
+ * const app = createApp(App)
20
+ * app.use(VueFire, {
21
+ * modules: [VueFireAuth()],
22
+ * })
23
+ * ```
24
+ */
10
25
export function VueFireAuth ( _app ?: never ) {
26
+ // ^
27
+ // app: never to prevent the user from just passing `VueFireAuth` without calling the function
28
+
11
29
// TODO: refactor to share across modules
12
30
if ( process . env . NODE_ENV !== 'production' ) {
13
31
if ( _app != null ) {
@@ -18,7 +36,7 @@ modules: [VueFireAuth()]`)
18
36
19
37
return ( firebaseApp : FirebaseApp , app : App ) => {
20
38
const user = getGlobalScope ( firebaseApp , app ) . run ( ( ) =>
21
- shallowRef < User | null | undefined > ( )
39
+ shallowRef < User | null | undefined > ( ) ,
22
40
) !
23
41
// userMap.set(app, user)
24
42
app . provide ( AuthUserInjectSymbol , user )
You can’t perform that action at this time.
0 commit comments