9 lines
254 B
TypeScript
9 lines
254 B
TypeScript
import { useEffect, useState } from 'react'
|
|
import { listenForLogin, User } from '../lib/firebase/users'
|
|
|
|
export const useUser = () => {
|
|
const [user, setUser] = useState<User | null>(null)
|
|
useEffect(() => listenForLogin(setUser), [])
|
|
return user
|
|
}
|