Skip to content

Documentation on until is confusing #1664

@alesmenzelsocialbakers

Description

@alesmenzelsocialbakers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions