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

whilst does not return value from iterator #40

Open
JamesHight opened this issue May 10, 2016 · 1 comment
Open

whilst does not return value from iterator #40

JamesHight opened this issue May 10, 2016 · 1 comment

Comments

@JamesHight
Copy link

According to the async documentation, the last iterator value from whilst should be returned to the result handler. This probably is an issue with other calls like until and doWhilst.

https://github.com/caolan/async#whilst

'use strict';


var pasync = require('pasync');

var count = 0;

pasync.whilst(
    function () { return count < 5; },
    function () {
        return new Promise(function(resolve, reject) {
            count++;
            setTimeout(function () {
                resolve(count);
            }, 1000);
        });

    }
).then(function(val) {
    console.log('value: ', val); // should be 5
}, function(err) {
    console.log('err: ', err);
});
@rosshadden
Copy link

rosshadden commented Aug 4, 2016

This is an issue with neo-async that was fixed in v1.7.1.

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

No branches or pull requests

2 participants