manifold/web/hooks/use-global-config.ts
2022-10-12 13:42:54 -05:00

13 lines
380 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)
}, [])
return globalConfig
}