@@ -21,10 +21,15 @@ type FlowId = {
21
21
* API for tracking reliability of your user interactions
22
22
*
23
23
* Example:
24
- * var flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
24
+ * const flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
25
+ * ...
25
26
* UserFlow.start(flowId, "user_click");
26
27
* ...
27
- * UserFlow.completeWithSuccess(flowId);
28
+ * UserFlow.addAnnotation(flowId, "cached", "true");
29
+ * ...
30
+ * UserFlow.addPoint(flowId, "reload");
31
+ * ...
32
+ * UserFlow.endSuccess(flowId);
28
33
*/
29
34
const UserFlow = {
30
35
/**
@@ -59,13 +64,13 @@ const UserFlow = {
59
64
}
60
65
} ,
61
66
62
- annotate (
67
+ addAnnotation (
63
68
flowId : FlowId ,
64
69
annotationName : string ,
65
70
annotationValue : string ,
66
71
) : void {
67
- if ( global . nativeUserFlowAnnotate ) {
68
- global . nativeUserFlowAnnotate (
72
+ if ( global . nativeUserFlowAddAnnotation ) {
73
+ global . nativeUserFlowAddAnnotation (
69
74
flowId . markerId ,
70
75
flowId . instanceKey ,
71
76
annotationName ,
@@ -74,32 +79,29 @@ const UserFlow = {
74
79
}
75
80
} ,
76
81
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 (
80
85
flowId . markerId ,
81
86
flowId . instanceKey ,
82
87
pointName ,
83
88
) ;
84
89
}
85
90
} ,
86
91
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 ) ;
93
95
}
94
96
} ,
95
97
96
- completeWithFail (
98
+ endFailure (
97
99
flowId : FlowId ,
98
100
errorName : string ,
99
101
debugInfo : ?string = null ,
100
102
) : void {
101
- if ( global . nativeUserFlowCompleteWithFail ) {
102
- global . nativeUserFlowCompleteWithFail (
103
+ if ( global . nativeUserFlowEndFail ) {
104
+ global . nativeUserFlowEndFail (
103
105
flowId . markerId ,
104
106
flowId . instanceKey ,
105
107
errorName ,
@@ -108,9 +110,9 @@ const UserFlow = {
108
110
}
109
111
} ,
110
112
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 (
114
116
flowId . markerId ,
115
117
flowId . instanceKey ,
116
118
cancelReason ,
0 commit comments