summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2020-02-23 18:04:42 -0800
committerAlexander Early <alexander.early@gmail.com>2020-02-23 18:04:42 -0800
commit16d3c56722456bb890ec086aa8602783a2ed3fea (patch)
treea0d493fc00cea85477f29dd40fad7afa62026837
parent01f88c98fc8088cf252f1f1a6cc9e135c895fa71 (diff)
downloadasync-16d3c56722456bb890ec086aa8602783a2ed3fea.tar.gz
fix until example. Closes #1688
-rw-r--r--lib/until.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/until.js b/lib/until.js
index 4f71ce9..b77b495 100644
--- a/lib/until.js
+++ b/lib/until.js
@@ -26,13 +26,15 @@ import wrapAsync from './internal/wrapAsync';
*
* @example
* const results = []
+ * let finished = false
* async.until(function test(page, cb) {
- * cb(null, page.next == null)
+ * cb(null, finished)
* }, function iter(next) {
* fetchPage(url, (err, body) => {
* if (err) return next(err)
* results = results.concat(body.objects)
- * next(err, body)
+ * finished = !!body.next
+ * next(err)
* })
* }, function done (err) {
* // all pages have been fetched