Skip to content

Commit

Permalink
Renaming UserFlow methods
Browse files Browse the repository at this point in the history
Summary: Renaming methods in UserFlow to match other APIs

Reviewed By: swillard13

Differential Revision: D24078270

fbshipit-source-id: c3a65d440e389d7b3c76de7706372265584353c8
  • Loading branch information
dmitry-voronkevich authored and facebook-github-bot committed Oct 2, 2020
1 parent 2c6d010 commit 923b77a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions Libraries/Reliability/UserFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ type FlowId = {
* API for tracking reliability of your user interactions
*
* Example:
* var flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
* const flowId = UserFlow.newFlowId(QuickLogItentifiersExample.EXAMPLE_EVENT);
* ...
* UserFlow.start(flowId, "user_click");
* ...
* UserFlow.completeWithSuccess(flowId);
* UserFlow.addAnnotation(flowId, "cached", "true");
* ...
* UserFlow.addPoint(flowId, "reload");
* ...
* UserFlow.endSuccess(flowId);
*/
const UserFlow = {
/**
Expand Down Expand Up @@ -59,13 +64,13 @@ const UserFlow = {
}
},

annotate(
addAnnotation(
flowId: FlowId,
annotationName: string,
annotationValue: string,
): void {
if (global.nativeUserFlowAnnotate) {
global.nativeUserFlowAnnotate(
if (global.nativeUserFlowAddAnnotation) {
global.nativeUserFlowAddAnnotation(
flowId.markerId,
flowId.instanceKey,
annotationName,
Expand All @@ -74,32 +79,29 @@ const UserFlow = {
}
},

markPoint(flowId: FlowId, pointName: string): void {
if (global.nativeUserFlowMarkPoint) {
global.nativeUserFlowMarkPoint(
addPoint(flowId: FlowId, pointName: string): void {
if (global.nativeUserFlowAddPoint) {
global.nativeUserFlowAddPoint(
flowId.markerId,
flowId.instanceKey,
pointName,
);
}
},

completeWithSuccess(flowId: FlowId): void {
if (global.nativeUserFlowCompleteWithSuccess) {
global.nativeUserFlowCompleteWithSuccess(
flowId.markerId,
flowId.instanceKey,
);
endSuccess(flowId: FlowId): void {
if (global.nativeUserFlowEndSuccess) {
global.nativeUserFlowEndSuccess(flowId.markerId, flowId.instanceKey);
}
},

completeWithFail(
endFailure(
flowId: FlowId,
errorName: string,
debugInfo: ?string = null,
): void {
if (global.nativeUserFlowCompleteWithFail) {
global.nativeUserFlowCompleteWithFail(
if (global.nativeUserFlowEndFail) {
global.nativeUserFlowEndFail(
flowId.markerId,
flowId.instanceKey,
errorName,
Expand All @@ -108,9 +110,9 @@ const UserFlow = {
}
},

cancel(flowId: FlowId, cancelReason: string): void {
if (global.nativeUserFlowCancel) {
global.nativeUserFlowCancel(
endCancel(flowId: FlowId, cancelReason: string): void {
if (global.nativeUserFlowEndCancel) {
global.nativeUserFlowEndCancel(
flowId.markerId,
flowId.instanceKey,
cancelReason,
Expand Down

0 comments on commit 923b77a

Please sign in to comment.