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

Generator#composeWith should support returning all composed generators when returnNewGenerator were true #1251

Closed
JasonHK opened this issue Jun 17, 2020 · 1 comment
Labels

Comments

@JasonHK
Copy link

JasonHK commented Jun 17, 2020

generator/lib/index.js

Lines 1102 to 1105 in 5cf1a18

if (Array.isArray(generator)) {
const generators = generator.map(gen => this.composeWith(gen, options));
return returnCompose(generators);
}

Shouldn't line 1103 be written like this?

-   const generators = generator.map(gen => this.composeWith(gen, options));
+   const generators = generator.map(gen => this.composeWith(gen, options, returnNewGenerator));

Currently, when generator was an array and returnNewGenerator was true, Generator#composeWith only returns an array of this (i.e. the current generator).

I think this is a mistake, although this should be easy to fix.

@mshima mshima added the bug label Jun 17, 2020
@mshima
Copy link
Member

mshima commented Jun 22, 2020

Fixed in #1252 thanks for reporting.

@mshima mshima closed this as completed Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants