manifold/web/hooks/use-global-config.ts
FRC ff6278b147
Featured items to homepage (#1024)
* Featured items to homepage

* Fix nits
2022-10-12 15:04:39 +01:00

13 lines
392 B
TypeScript

import { GlobalConfig } from 'common/globalConfig'
import { useEffect, useState } from 'react'
import { listenForGlobalConfig } from 'web/lib/firebase/globalConfig'
export const useGlobalConfig = () => {
const [globalConfig, setGlobalConfig] = useState<GlobalConfig | null>(null)
useEffect(() => {
listenForGlobalConfig(setGlobalConfig)
}, [globalConfig])
return globalConfig
}