Documentation for until in v3.x has the parameters swapped in the example below:
http://caolan.github.io/async/v3/docs.html#until
The doc says: async.until(test, iteratee, callback), but the example shows async.until(iteratee, test, callback).
const results = []
async.until(function iter(next) {
fetchPage(url, (err, body) => {
if (err) return next(err)
results = results.concat(body.objects)
next(err, body)
})
}, function test(page, cb) {
cb(null, page.next == null)
}, function done (err) {
// all pages have been fetched
})
According to the source it should be until(test, iteratee, callback).
http://caolan.github.io/async/v3/until.js.html
Documentation for until in v3.x has the parameters swapped in the example below:
http://caolan.github.io/async/v3/docs.html#until
The doc says:
async.until(test, iteratee, callback), but the example showsasync.until(iteratee, test, callback).According to the source it should be
until(test, iteratee, callback).http://caolan.github.io/async/v3/until.js.html