Skip to content

Commit

Permalink
fix until example. Closes #1688
Browse files Browse the repository at this point in the history
  • Loading branch information
aearly committed Feb 24, 2020
1 parent 01f88c9 commit 16d3c56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/until.js
Expand Up @@ -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
Expand Down

0 comments on commit 16d3c56

Please sign in to comment.