From 16d3c56722456bb890ec086aa8602783a2ed3fea Mon Sep 17 00:00:00 2001 From: Alexander Early Date: Sun, 23 Feb 2020 18:04:42 -0800 Subject: fix until example. Closes #1688 --- lib/until.js | 6 ++++-- 1 file 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 -- cgit v1.2.1