package.initializers.index.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
import _typeof from "@babel/runtime/helpers/typeof";
// TODO: kept for backward compatibility.
import useDisplayErrorPage from "../react-utils/useDisplayErrorPage";
import initializeAxios from "./axios";
import initializeDayjs from "./dayjs";
import initializeGlobalProps from "./globalProps";
import initializeI18n, { taxonomies } from "./i18n";
import initializeLogger from "./logger";
import initializeMixpanel from "./mixpanel";
import disableReactDevTools from "./reactDevTools";
// eslint-disable-next-line import/no-mutable-exports
var globalProps = {};
export { globalProps, useDisplayErrorPage, taxonomies };
export default function initializeApplication(_ref) {
var translationResources = _ref.translationResources,
skip = _ref.skip;
if (!(skip !== null && skip !== void 0 && skip.globalProps)) {
initializeGlobalProps();
// eslint-disable-next-line @bigbinary/neeto/no-globalProps-reassignment
globalProps = window.globalProps;
}
if (_typeof(skip === null || skip === void 0 ? void 0 : skip.axios) === "object" || !(skip !== null && skip !== void 0 && skip.axios)) {
initializeAxios(skip === null || skip === void 0 ? void 0 : skip.axios);
}
if (!(skip !== null && skip !== void 0 && skip.i18n)) initializeI18n(translationResources);
if (!(skip !== null && skip !== void 0 && skip.logger)) initializeLogger();
if (!(skip !== null && skip !== void 0 && skip.dayjs)) initializeDayjs(skip === null || skip === void 0 ? void 0 : skip.timezone);
if (process.env.NODE_ENV === "production") disableReactDevTools();
var pageLoader = document.getElementById("neeto-page-loader");
if (pageLoader) pageLoader.remove();
initializeMixpanel(skip);
}
//# sourceMappingURL=index.js.map