import * as React from 'react' ; import { Environment } from 'relay-runtime' ; import Config from '../core/Config' ; export type GlobalContextValueType = { config : Config ; environment : Environment ; } ; const value = { config : null , environment : null , } ; export const getConfig = ( ) : Config => value . config ; export const getEnvironment = ( ) : Environment => value . environment ; export const setConfig = ( config ) : void => { value . config = config ; } ; export const setEnvironment = ( environment ) : void => { value . environment = environment ; } ; const { Provider , Consumer } = React . createContext < GlobalContextValueType > ( value ) ; export default { Provider , Consumer , } ;