Skip to content

Commit 173f5f1

Browse files
authored
refactor(retry): Spell success properly (#1254)
1 parent 677e902 commit 173f5f1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/transporter/src/concerns/retryDecision.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export const retryDecision = <TResponse>(
2626
}
2727

2828
if (isSuccess(response)) {
29-
return outcomes.onSucess(response);
29+
return outcomes.onSuccess(response);
3030
}
3131

3232
return outcomes.onFail(response);
3333
};
3434

3535
export type Outcomes<TResponse> = {
3636
readonly onFail: (response: Response) => Readonly<Promise<never>>;
37-
readonly onSucess: (response: Response) => Readonly<Promise<TResponse>>;
37+
readonly onSuccess: (response: Response) => Readonly<Promise<TResponse>>;
3838
readonly onRetry: (response: Response) => Readonly<Promise<TResponse>>;
3939
};

packages/transporter/src/concerns/retryableRequest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ export function retryableRequest<TResponse>(
9494
};
9595

9696
const decisions: Outcomes<TResponse> = {
97-
onSucess: response => deserializeSuccess(response),
97+
/**
98+
* @deprecated this property is deprecated in favor of `onSuccess`
99+
*/
100+
onSucess: response => onSuccess(response),
101+
onSuccess: response => deserializeSuccess(response),
98102
onRetry(response) {
99103
const stackFrame = pushToStackTrace(response);
100104

0 commit comments

Comments
 (0)