Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on until is confusing #1664

Closed
alesmenzelsocialbakers opened this issue Jun 14, 2019 · 0 comments
Closed

Documentation on until is confusing #1664

alesmenzelsocialbakers opened this issue Jun 14, 2019 · 0 comments

Comments

@alesmenzelsocialbakers
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants