@bigbinary/neeto-commons-frontend 2.1.14 → 2.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/initializers.cjs.js +0 -15
- package/initializers.cjs.js.map +1 -1
- package/initializers.d.ts +0 -1
- package/initializers.js +4 -18
- package/initializers.js.map +1 -1
- package/package.json +1 -3
- package/utils.cjs.js +4 -0
- package/utils.cjs.js.map +1 -1
- package/utils.d.ts +15 -1
- package/utils.js +5 -2
- package/utils.js.map +1 -1
package/initializers.d.ts
CHANGED
package/initializers.js
CHANGED
|
@@ -5,10 +5,9 @@ import i18n from 'i18next';
|
|
|
5
5
|
import { serializeKeysToSnakeCase, keysToCamelCase, matches, deepFreezeObject } from '@bigbinary/neeto-commons-frontend/pure';
|
|
6
6
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
|
|
7
7
|
import { Toastr } from '@bigbinary/neetoui';
|
|
8
|
-
import { evolve, omit, values, mergeDeepLeft, curry, mergeAll
|
|
8
|
+
import { evolve, omit, values, mergeDeepLeft, curry, mergeAll } from 'ramda';
|
|
9
9
|
import { initReactI18next } from 'react-i18next';
|
|
10
10
|
import Logger from 'js-logger';
|
|
11
|
-
import mixpanel from 'mixpanel-browser';
|
|
12
11
|
|
|
13
12
|
function _typeof$1(obj) {
|
|
14
13
|
"@babel/helpers - typeof";
|
|
@@ -2460,18 +2459,6 @@ function initializeLogger() {
|
|
|
2460
2459
|
window.logger = Logger;
|
|
2461
2460
|
}
|
|
2462
2461
|
|
|
2463
|
-
function initializeMixPanel() {
|
|
2464
|
-
var isUserLoggedIn = !either(isEmpty, isNil)(globalProps.user);
|
|
2465
|
-
mixpanel.init(process.env.MIXPANEL_TOKEN || "TEST_TOKEN");
|
|
2466
|
-
if (!isUserLoggedIn) return;
|
|
2467
|
-
mixpanel.people.set({
|
|
2468
|
-
$email: globalProps.user.email,
|
|
2469
|
-
$fist_name: globalProps.user.firstName,
|
|
2470
|
-
$last_name: globalProps.user.lastName
|
|
2471
|
-
});
|
|
2472
|
-
mixpanel.identify(globalProps.user.email);
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
2462
|
var isObjectOrFunction = function isObjectOrFunction(object) {
|
|
2476
2463
|
var type = _typeof$1(object);
|
|
2477
2464
|
return type === "function" || type === "object" && !!object;
|
|
@@ -2491,16 +2478,15 @@ function disableReactDevTools() {
|
|
|
2491
2478
|
}
|
|
2492
2479
|
|
|
2493
2480
|
// eslint-disable-next-line import/no-mutable-exports
|
|
2494
|
-
var globalProps
|
|
2481
|
+
var globalProps = {};
|
|
2495
2482
|
function initializeApplication(_ref) {
|
|
2496
2483
|
var translationResources = _ref.translationResources,
|
|
2497
2484
|
skip = _ref.skip;
|
|
2498
2485
|
if (!(skip !== null && skip !== void 0 && skip.globalProps)) {
|
|
2499
2486
|
initializeGlobalProps();
|
|
2500
2487
|
// eslint-disable-next-line @bigbinary/neeto/no-globalProps-reassignment
|
|
2501
|
-
globalProps
|
|
2488
|
+
globalProps = window.globalProps;
|
|
2502
2489
|
}
|
|
2503
|
-
if (!(skip !== null && skip !== void 0 && skip.mixpanel)) initializeMixPanel();
|
|
2504
2490
|
if (_typeof$1(skip === null || skip === void 0 ? void 0 : skip.axios) === "object" || !(skip !== null && skip !== void 0 && skip.axios)) {
|
|
2505
2491
|
initializeAxios(skip === null || skip === void 0 ? void 0 : skip.axios);
|
|
2506
2492
|
}
|
|
@@ -2509,5 +2495,5 @@ function initializeApplication(_ref) {
|
|
|
2509
2495
|
if (process.env.NODE_ENV === "production") disableReactDevTools();
|
|
2510
2496
|
}
|
|
2511
2497
|
|
|
2512
|
-
export { initializeApplication as default, globalProps
|
|
2498
|
+
export { initializeApplication as default, globalProps };
|
|
2513
2499
|
//# sourceMappingURL=initializers.js.map
|