import { default as App , app } from './App' ; export default function useGlobalData < G extends Record < string , any > > ( passInApp ? ) { const realGlobal = passInApp || app ; return { get < T extends keyof G > ( key ) { return realGlobal . reactiveData . data [ key as string ] ; } , set < T extends keyof G > ( key , value ) { if ( key in realGlobal . reactiveData ) { realGlobal . reactiveData . data [ key as string ] = value ; } else { realGlobal . reactiveData . data = { ... realGlobal . reactiveData . data , [ key ] : value , } ; } } , } ; }