Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell success properly #1254

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>>;
};
6 changes: 5 additions & 1 deletion packages/transporter/src/concerns/retryableRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ export function retryableRequest<TResponse>(
};

const decisions: Outcomes<TResponse> = {
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);

Expand Down