13 lines
270 B
TypeScript
13 lines
270 B
TypeScript
|
import { useState, useEffect } from 'react'
|
||
|
import { listenForAllUsers, User } from '../lib/firebase/users'
|
||
|
|
||
|
export const useUsers = () => {
|
||
|
const [users, setUsers] = useState<User[]>([])
|
||
|
|
||
|
useEffect(() => {
|
||
|
listenForAllUsers(setUsers)
|
||
|
}, [])
|
||
|
|
||
|
return users
|
||
|
}
|