react-native-edgee 1.0.5 → 1.0.7

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.
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./expo-router"), exports);
18
- __exportStar(require("./react-navigation"), exports);
@@ -1,9 +0,0 @@
1
- import type { EdgeeClient } from "../index";
2
- type NavigationRef = {
3
- getCurrentRoute?: () => {
4
- name: string;
5
- } | undefined;
6
- addListener?: (event: string, callback: () => void) => () => void;
7
- };
8
- export declare function installAutoPageview(navigationRef: NavigationRef, edgee: Pick<EdgeeClient, "screen">): () => void;
9
- export {};
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installAutoPageview = installAutoPageview;
4
- function installAutoPageview(navigationRef, edgee) {
5
- var _a;
6
- let previousRouteName;
7
- const report = () => {
8
- var _a;
9
- try {
10
- const route = (_a = navigationRef.getCurrentRoute) === null || _a === void 0 ? void 0 : _a.call(navigationRef);
11
- if (!route)
12
- return;
13
- const current = route.name;
14
- if (current !== previousRouteName) {
15
- // Fire a Page View as a track event
16
- edgee.screen(current, { path: `/${current}` });
17
- previousRouteName = current;
18
- }
19
- }
20
- catch {
21
- // no-op
22
- }
23
- };
24
- // initial fire
25
- report();
26
- // subscribe to changes
27
- const unsubscribe = (_a = navigationRef.addListener) === null || _a === void 0 ? void 0 : _a.call(navigationRef, "state", report);
28
- return () => {
29
- try {
30
- unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe();
31
- }
32
- catch {
33
- // no-op
34
- }
35
- };
36
- }