@shopify/hydrogen 1.6.5 → 1.6.6
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.
|
@@ -35,14 +35,19 @@ function publish(eventname, guardDup = false, payload = {}) {
|
|
|
35
35
|
const namedspacedEventname = getNamedspacedEventname(eventname);
|
|
36
36
|
// De-dup events due to re-renders
|
|
37
37
|
if (guardDup) {
|
|
38
|
-
const
|
|
38
|
+
const guardName = namedspacedEventname + ':' + pageAnalyticsData.url;
|
|
39
|
+
const eventGuardTimeout = guardDupEvents[guardName];
|
|
39
40
|
if (eventGuardTimeout) {
|
|
40
|
-
clearTimeout(eventGuardTimeout);
|
|
41
|
+
clearTimeout(eventGuardTimeout.timeout);
|
|
41
42
|
}
|
|
42
43
|
const namespacedTimeout = setTimeout(() => {
|
|
43
|
-
publishEvent(namedspacedEventname,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
publishEvent(namedspacedEventname, guardDupEvents[guardName].data);
|
|
45
|
+
delete guardDupEvents[guardName];
|
|
46
|
+
}, 2000);
|
|
47
|
+
guardDupEvents[guardName] = {
|
|
48
|
+
timeout: namespacedTimeout,
|
|
49
|
+
data: mergeDeep(pageAnalyticsData, payload),
|
|
50
|
+
};
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
53
|
publishEvent(namedspacedEventname, mergeDeep(pageAnalyticsData, payload));
|
package/dist/esnext/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.6.
|
|
1
|
+
export declare const LIB_VERSION = "1.6.6";
|
package/dist/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = '1.6.
|
|
1
|
+
export const LIB_VERSION = '1.6.6';
|