From 682cc43ce1d384fe543f65bdf917b4e89cd51707 Mon Sep 17 00:00:00 2001 From: Mike Roest Date: Wed, 11 Oct 2023 07:29:05 -0600 Subject: [PATCH] fix readme documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08e00e5..0408a12 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 }