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
This commit is contained in:
Родитель
e3eeadb63a
Коммит
c565a770eb
|
@ -53,22 +53,6 @@ const QuickPerformanceLogger = {
|
|||
},
|
||||
|
||||
markerAnnotate(
|
||||
markerId: number,
|
||||
annotationKey: string,
|
||||
annotationValue: string,
|
||||
instanceKey: number = DUMMY_INSTANCE_KEY,
|
||||
): void {
|
||||
if (global.nativeQPLMarkerAnnotate) {
|
||||
global.nativeQPLMarkerAnnotate(
|
||||
markerId,
|
||||
instanceKey,
|
||||
annotationKey,
|
||||
annotationValue,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
markerAnnotateWithMap(
|
||||
markerId: number,
|
||||
annotations: AnnotationsMap,
|
||||
instanceKey: number = DUMMY_INSTANCE_KEY,
|
||||
|
@ -76,10 +60,10 @@ const QuickPerformanceLogger = {
|
|||
if (global.nativeQPLMarkerAnnotateWithMap) {
|
||||
global.nativeQPLMarkerAnnotateWithMap(markerId, annotations, instanceKey);
|
||||
} else if (global.nativeQPLMarkerAnnotate) {
|
||||
for (var type of ['string']) {
|
||||
var keyValsOfType = annotations[type];
|
||||
if (keyValsOfType !== null && keyValsOfType !== undefined) {
|
||||
for (var annotationKey of Object.keys(keyValsOfType)) {
|
||||
for (const type of ['string']) {
|
||||
const keyValsOfType = annotations[type];
|
||||
if (keyValsOfType != null) {
|
||||
for (const annotationKey of Object.keys(keyValsOfType)) {
|
||||
global.nativeQPLMarkerAnnotate(
|
||||
markerId,
|
||||
instanceKey,
|
||||
|
|
Загрузка…
Ссылка в новой задаче