2022-10-12 14:04:39 +00:00
|
|
|
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)
|
2022-10-12 18:42:54 +00:00
|
|
|
}, [])
|
2022-10-12 14:04:39 +00:00
|
|
|
return globalConfig
|
|
|
|
}
|