Skip to content

Commit b6ea5d2

Browse files
committed
refactor: migrate all @react-native-firebase/perf references to use Firebase's modular API
1 parent 79b0f48 commit b6ea5d2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/libs/Firebase/index.native.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/* eslint-disable no-unused-vars */
22
import {log as crashlyticsLog, getCrashlytics} from '@react-native-firebase/crashlytics';
3-
import perf from '@react-native-firebase/perf';
3+
import {getPerformance} from '@react-native-firebase/perf';
44
import * as Environment from '@libs/Environment/Environment';
55
import type {FirebaseAttributes, Log, StartTrace, StopTrace, TraceMap} from './types';
66
import utils from './utils';
77

88
const crashlytics = getCrashlytics();
9+
const perf = getPerformance();
910
const traceMap: TraceMap = {};
1011

1112
const startTrace: StartTrace = (customEventName) => {
@@ -20,9 +21,7 @@ const startTrace: StartTrace = (customEventName) => {
2021

2122
const attributes: FirebaseAttributes = utils.getAttributes(['accountId', 'personalDetailsLength', 'reportActionsLength', 'reportsLength', 'policiesLength']);
2223

23-
perf()
24-
.startTrace(customEventName)
25-
.then((trace) => {
24+
perf.startTrace(customEventName).then((trace) => {
2625
Object.entries(attributes).forEach(([name, value]) => {
2726
trace.putAttribute(name, value);
2827
});

0 commit comments

Comments
 (0)