import _ from 'lodash' import { useEffect, useState } from 'react' import { Contract, listenForContracts, listenForHotContracts, } from '../lib/firebase/contracts' export const useContracts = () => { const [contracts, setContracts] = useState() useEffect(() => { return listenForContracts(setContracts) }, []) return contracts } export const useHotContracts = () => { const [hotContracts, setHotContracts] = useState() useEffect(() => listenForHotContracts(setHotContracts), []) return hotContracts }