-
-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathlazy.ts
More file actions
66 lines (56 loc) · 2.44 KB
/
lazy.ts
File metadata and controls
66 lines (56 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { getClient } from '@sentry/core';
import { feedbackIntegration, MOBILE_FEEDBACK_INTEGRATION_NAME } from './integration';
/**
* Lazy loads the feedback integration if it is not already loaded.
*/
export function lazyLoadFeedbackIntegration(): void {
const integration = getClient()?.getIntegrationByName(MOBILE_FEEDBACK_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration(feedbackIntegration());
}
}
export const AUTO_INJECT_FEEDBACK_INTEGRATION_NAME = 'AutoInjectMobileFeedback';
/**
* Lazy loads the auto inject feedback integration if it is not already loaded.
*/
export function lazyLoadAutoInjectFeedbackIntegration(): void {
const integration = getClient()?.getIntegrationByName(AUTO_INJECT_FEEDBACK_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration({ name: AUTO_INJECT_FEEDBACK_INTEGRATION_NAME });
}
}
export const AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileFeedbackButton';
/**
* Lazy loads the auto inject feedback button integration if it is not already loaded.
*/
export function lazyLoadAutoInjectFeedbackButtonIntegration(): void {
const integration = getClient()?.getIntegrationByName(AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration({ name: AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME });
}
}
export const SHAKE_TO_REPORT_INTEGRATION_NAME = 'ShakeToReport';
/**
* Lazy loads the shake to report integration if it is not already loaded.
*/
export function lazyLoadShakeToReportIntegration(): void {
const integration = getClient()?.getIntegrationByName(SHAKE_TO_REPORT_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration({ name: SHAKE_TO_REPORT_INTEGRATION_NAME });
}
}
export const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton';
/**
* Lazy loads the auto inject screenshot button integration if it is not already loaded.
*/
export function lazyLoadAutoInjectScreenshotButtonIntegration(): void {
const integration = getClient()?.getIntegrationByName(AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration({ name: AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME });
}
}