import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "./index.mjs";
const useGlobalVariable = (key)=>{
    const app = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useApp)();
    const variable = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>app.getGlobalVar(key), [
        app,
        key
    ]);
    if ((0, __WEBPACK_EXTERNAL_MODULE_lodash__.isFunction)(variable)) try {
        return variable();
    } catch (error) {
        console.error("Error calling global variable function for key: ".concat(key), error);
        return;
    }
    return variable;
};
export { useGlobalVariable };
