From 173f5f161665cef4c51b132c4302229ed34c485a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 2 Mar 2021 13:22:27 +0100 Subject: [PATCH] refactor(retry): Spell success properly (#1254) --- packages/transporter/src/concerns/retryDecision.ts | 4 ++-- packages/transporter/src/concerns/retryableRequest.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/transporter/src/concerns/retryDecision.ts b/packages/transporter/src/concerns/retryDecision.ts index 75faaf6bb..4c8a7bb57 100644 --- a/packages/transporter/src/concerns/retryDecision.ts +++ b/packages/transporter/src/concerns/retryDecision.ts @@ -26,7 +26,7 @@ export const retryDecision = ( } if (isSuccess(response)) { - return outcomes.onSucess(response); + return outcomes.onSuccess(response); } return outcomes.onFail(response); @@ -34,6 +34,6 @@ export const retryDecision = ( export type Outcomes = { readonly onFail: (response: Response) => Readonly>; - readonly onSucess: (response: Response) => Readonly>; + readonly onSuccess: (response: Response) => Readonly>; readonly onRetry: (response: Response) => Readonly>; }; diff --git a/packages/transporter/src/concerns/retryableRequest.ts b/packages/transporter/src/concerns/retryableRequest.ts index 6ea17c2e1..ebcf8fa65 100644 --- a/packages/transporter/src/concerns/retryableRequest.ts +++ b/packages/transporter/src/concerns/retryableRequest.ts @@ -94,7 +94,11 @@ export function retryableRequest( }; const decisions: Outcomes = { - onSucess: response => deserializeSuccess(response), + /** + * @deprecated this property is deprecated in favor of `onSuccess` + */ + onSucess: response => onSuccess(response), + onSuccess: response => deserializeSuccess(response), onRetry(response) { const stackFrame = pushToStackTrace(response);