import { AppEnv , createAppEnv } from "./appEnv" ; import { assignObjImmutableProp } from "./prop" ; import { getGlobal } from "./global" ; const GLOBAL_INSTANCE_REF = "@@__ButtercupAppEnv" ; memberof export function getSharedAppEnv ( ) { const globalRef = getGlobal ( ) ; if ( ! globalRef [ GLOBAL_INSTANCE_REF ] ) { const appEnv = createAppEnv ( ) ; assignObjImmutableProp ( globalRef , GLOBAL_INSTANCE_REF , appEnv ) ; } return globalRef [ GLOBAL_INSTANCE_REF ] ; }