manifold/web/hooks/use-users.ts

13 lines
270 B
TypeScript
Raw Normal View History

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
}