Skip to content

Commit

Permalink
refactor(retry): Spell success properly
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Feb 26, 2021
1 parent 677e902 commit 2df16ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/transporter/src/concerns/retryDecision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const retryDecision = <TResponse>(
}

if (isSuccess(response)) {
return outcomes.onSucess(response);
return outcomes.onSuccess(response);
}

return outcomes.onFail(response);
};

export type Outcomes<TResponse> = {
readonly onFail: (response: Response) => Readonly<Promise<never>>;
readonly onSucess: (response: Response) => Readonly<Promise<TResponse>>;
readonly onSuccess: (response: Response) => Readonly<Promise<TResponse>>;
readonly onRetry: (response: Response) => Readonly<Promise<TResponse>>;
};
2 changes: 1 addition & 1 deletion packages/transporter/src/concerns/retryableRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function retryableRequest<TResponse>(
};

const decisions: Outcomes<TResponse> = {
onSucess: response => deserializeSuccess(response),
onSuccess: response => deserializeSuccess(response),
onRetry(response) {
const stackFrame = pushToStackTrace(response);

Expand Down

0 comments on commit 2df16ea

Please sign in to comment.