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

fix readme documentation #13

Merged
merged 1 commit into from
Oct 11, 2023
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function retry (retries, delays, allowedStatuses, retryCallback) {}
* **a list of numbers:** delays between the first few retries, in order given. If there are more retries than
numbers on this list, any subsequent retries will be delayed by the last number on the list.
* `allowedStatuses`: list of HTTP statuses that aren't considered a failure by which we need to retry
* `retryCallback`: this callback takes a single argument, the `response` object, and must performs an evaluation on it
* `retryCallback`: this callback takes two arguments, the err, and the `response` object, and must performs an evaluation on it
that must return either `true` or `false`. Returning `false` stops any further retries.

### Examples
Expand All @@ -61,7 +61,7 @@ superagent

superagent
.get('https://segment.io')
.retry(5, [1000, 3000], [], (res, err) => {
.retry(5, [1000, 3000], [], (err, res) => {
if (res.status === 400 && res.text.includes('banana')) {
return true
}
Expand Down