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'
77
88export { setupOnAuthStateChanged , useCurrentUser } from './user'
99
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+ */
1025export function VueFireAuth ( _app ?: never ) {
26+ // ^
27+ // app: never to prevent the user from just passing `VueFireAuth` without calling the function
28+
1129 // TODO: refactor to share across modules
1230 if ( process . env . NODE_ENV !== 'production' ) {
1331 if ( _app != null ) {
@@ -18,7 +36,7 @@ modules: [VueFireAuth()]`)
1836
1937 return ( firebaseApp : FirebaseApp , app : App ) => {
2038 const user = getGlobalScope ( firebaseApp , app ) . run ( ( ) =>
21- shallowRef < User | null | undefined > ( )
39+ shallowRef < User | null | undefined > ( ) ,
2240 ) !
2341 // userMap.set(app, user)
2442 app . provide ( AuthUserInjectSymbol , user )
You can’t perform that action at this time.
0 commit comments