Skip to content

Commit c565a77

Browse files
Dmytro Voronkevychfacebook-github-bot
authored andcommitted
Migrating all qpl.markerAnnotate call sites to the new signature
Summary: As part of unifying JS QPL interface, I'm bringing markerAnnotate to the parity with Web version. At the moment it supports only string annotations, but I'm adding support for ints, arrays of ints, arrays of strings, etc. ## Changelog: [Internal] [Changed] - Refactored markerAnnotateWithMap -> markerAnnotate Reviewed By: eddyerburgh Differential Revision: D40796535 fbshipit-source-id: 9831e353036835b97bb7b2f60085016034c04269
1 parent e3eeadb commit c565a77

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

Libraries/Performance/QuickPerformanceLogger.js

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,17 @@ const QuickPerformanceLogger = {
5353
},
5454

5555
markerAnnotate(
56-
markerId: number,
57-
annotationKey: string,
58-
annotationValue: string,
59-
instanceKey: number = DUMMY_INSTANCE_KEY,
60-
): void {
61-
if (global.nativeQPLMarkerAnnotate) {
62-
global.nativeQPLMarkerAnnotate(
63-
markerId,
64-
instanceKey,
65-
annotationKey,
66-
annotationValue,
67-
);
68-
}
69-
},
70-
71-
markerAnnotateWithMap(
7256
markerId: number,
7357
annotations: AnnotationsMap,
7458
instanceKey: number = DUMMY_INSTANCE_KEY,
7559
): void {
7660
if (global.nativeQPLMarkerAnnotateWithMap) {
7761
global.nativeQPLMarkerAnnotateWithMap(markerId, annotations, instanceKey);
7862
} else if (global.nativeQPLMarkerAnnotate) {
79-
for (var type of ['string']) {
80-
var keyValsOfType = annotations[type];
81-
if (keyValsOfType !== null && keyValsOfType !== undefined) {
82-
for (var annotationKey of Object.keys(keyValsOfType)) {
63+
for (const type of ['string']) {
64+
const keyValsOfType = annotations[type];
65+
if (keyValsOfType != null) {
66+
for (const annotationKey of Object.keys(keyValsOfType)) {
8367
global.nativeQPLMarkerAnnotate(
8468
markerId,
8569
instanceKey,

0 commit comments

Comments
 (0)