Skip to content

Commit 923b77a

Browse files
Renaming UserFlow methods
Summary: Renaming methods in UserFlow to match other APIs Reviewed By: swillard13 Differential Revision: D24078270 fbshipit-source-id: c3a65d440e389d7b3c76de7706372265584353c8
1 parent 2c6d010 commit 923b77a

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

Libraries/Reliability/UserFlow.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ type FlowId = {
2121
* API for tracking reliability of your user interactions
2222
*
2323
* Example:
24-
* var flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
24+
* const flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
25+
* ...
2526
* UserFlow.start(flowId, "user_click");
2627
* ...
27-
* UserFlow.completeWithSuccess(flowId);
28+
* UserFlow.addAnnotation(flowId, "cached", "true");
29+
* ...
30+
* UserFlow.addPoint(flowId, "reload");
31+
* ...
32+
* UserFlow.endSuccess(flowId);
2833
*/
2934
const UserFlow = {
3035
/**
@@ -59,13 +64,13 @@ const UserFlow = {
5964
}
6065
},
6166

62-
annotate(
67+
addAnnotation(
6368
flowId: FlowId,
6469
annotationName: string,
6570
annotationValue: string,
6671
): void {
67-
if (global.nativeUserFlowAnnotate) {
68-
global.nativeUserFlowAnnotate(
72+
if (global.nativeUserFlowAddAnnotation) {
73+
global.nativeUserFlowAddAnnotation(
6974
flowId.markerId,
7075
flowId.instanceKey,
7176
annotationName,
@@ -74,32 +79,29 @@ const UserFlow = {
7479
}
7580
},
7681

77-
markPoint(flowId: FlowId, pointName: string): void {
78-
if (global.nativeUserFlowMarkPoint) {
79-
global.nativeUserFlowMarkPoint(
82+
addPoint(flowId: FlowId, pointName: string): void {
83+
if (global.nativeUserFlowAddPoint) {
84+
global.nativeUserFlowAddPoint(
8085
flowId.markerId,
8186
flowId.instanceKey,
8287
pointName,
8388
);
8489
}
8590
},
8691

87-
completeWithSuccess(flowId: FlowId): void {
88-
if (global.nativeUserFlowCompleteWithSuccess) {
89-
global.nativeUserFlowCompleteWithSuccess(
90-
flowId.markerId,
91-
flowId.instanceKey,
92-
);
92+
endSuccess(flowId: FlowId): void {
93+
if (global.nativeUserFlowEndSuccess) {
94+
global.nativeUserFlowEndSuccess(flowId.markerId, flowId.instanceKey);
9395
}
9496
},
9597

96-
completeWithFail(
98+
endFailure(
9799
flowId: FlowId,
98100
errorName: string,
99101
debugInfo: ?string = null,
100102
): void {
101-
if (global.nativeUserFlowCompleteWithFail) {
102-
global.nativeUserFlowCompleteWithFail(
103+
if (global.nativeUserFlowEndFail) {
104+
global.nativeUserFlowEndFail(
103105
flowId.markerId,
104106
flowId.instanceKey,
105107
errorName,
@@ -108,9 +110,9 @@ const UserFlow = {
108110
}
109111
},
110112

111-
cancel(flowId: FlowId, cancelReason: string): void {
112-
if (global.nativeUserFlowCancel) {
113-
global.nativeUserFlowCancel(
113+
endCancel(flowId: FlowId, cancelReason: string): void {
114+
if (global.nativeUserFlowEndCancel) {
115+
global.nativeUserFlowEndCancel(
114116
flowId.markerId,
115117
flowId.instanceKey,
116118
cancelReason,

0 commit comments

Comments
 (0)