@ikas/storefront 0.1.22-alpha.3 → 0.1.22-alpha.5
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/build/index.es.js +12 -7
- package/build/index.js +11 -6
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeAutoObservable, configure, makeObservable, observable, runInAction,
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path$1 from 'path';
|
|
4
4
|
import getConfig from 'next/config';
|
|
5
|
-
import React, { createElement, Fragment as Fragment$1,
|
|
5
|
+
import React, { createElement, Fragment as Fragment$1, useEffect, useMemo, useState, useRef, useCallback } from 'react';
|
|
6
6
|
import { useRouter } from 'next/router';
|
|
7
7
|
import { observer } from 'mobx-react-lite';
|
|
8
8
|
import Head from 'next/head';
|
|
@@ -33357,13 +33357,18 @@ var AnalyticsBody = function () {
|
|
|
33357
33357
|
var gtmId = IkasStorefrontConfig.gtmId;
|
|
33358
33358
|
var fbpId = IkasStorefrontConfig.fbpId;
|
|
33359
33359
|
var router = useRouter();
|
|
33360
|
-
var routeChangeListener = useState(function () { return function () {
|
|
33361
|
-
//@ts-ignore
|
|
33362
|
-
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33363
|
-
}; })[0];
|
|
33364
33360
|
useEffect(function () {
|
|
33365
|
-
|
|
33366
|
-
|
|
33361
|
+
var handleRouteChange = function () {
|
|
33362
|
+
console.log("route change");
|
|
33363
|
+
//@ts-ignore
|
|
33364
|
+
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33365
|
+
};
|
|
33366
|
+
router.events.on("routeChangeStart", handleRouteChange);
|
|
33367
|
+
// If the component is unmounted, unsubscribe
|
|
33368
|
+
// from the event with the `off` method:
|
|
33369
|
+
return function () {
|
|
33370
|
+
router.events.off("routeChangeStart", handleRouteChange);
|
|
33371
|
+
};
|
|
33367
33372
|
}, []);
|
|
33368
33373
|
return (createElement(Fragment$1, null,
|
|
33369
33374
|
gtmId && (createElement("noscript", { dangerouslySetInnerHTML: {
|
package/build/index.js
CHANGED
|
@@ -33364,13 +33364,18 @@ var AnalyticsBody = function () {
|
|
|
33364
33364
|
var gtmId = IkasStorefrontConfig.gtmId;
|
|
33365
33365
|
var fbpId = IkasStorefrontConfig.fbpId;
|
|
33366
33366
|
var router$1 = router.useRouter();
|
|
33367
|
-
var routeChangeListener = React.useState(function () { return function () {
|
|
33368
|
-
//@ts-ignore
|
|
33369
|
-
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33370
|
-
}; })[0];
|
|
33371
33367
|
React.useEffect(function () {
|
|
33372
|
-
|
|
33373
|
-
|
|
33368
|
+
var handleRouteChange = function () {
|
|
33369
|
+
console.log("route change");
|
|
33370
|
+
//@ts-ignore
|
|
33371
|
+
IkasStorefrontConfig.store.customerStore.routeChangeInit();
|
|
33372
|
+
};
|
|
33373
|
+
router$1.events.on("routeChangeStart", handleRouteChange);
|
|
33374
|
+
// If the component is unmounted, unsubscribe
|
|
33375
|
+
// from the event with the `off` method:
|
|
33376
|
+
return function () {
|
|
33377
|
+
router$1.events.off("routeChangeStart", handleRouteChange);
|
|
33378
|
+
};
|
|
33374
33379
|
}, []);
|
|
33375
33380
|
return (React.createElement(React.Fragment, null,
|
|
33376
33381
|
gtmId && (React.createElement("noscript", { dangerouslySetInnerHTML: {
|