Skip to content

fix Flow typings for flow() - mobx4 #2174

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

Merged
merged 1 commit into from
Oct 23, 2019
Merged

fix Flow typings for flow() - mobx4 #2174

merged 1 commit into from
Oct 23, 2019

Conversation

vonovak
Copy link
Contributor

@vonovak vonovak commented Oct 23, 2019

same as #2164 for mobx 4

@danielkcz
Copy link
Contributor

Thanks!

@danielkcz danielkcz merged commit 7d7f8ec into mobxjs:mobx4-master Oct 23, 2019
@vonovak vonovak deleted the fixFlowMobx4 branch October 23, 2019 08:18
@vovkasm
Copy link

vovkasm commented Nov 18, 2019

With mobx 4.15.0 I have this error now:

node_modules/mobx/lib/api/flow.d.ts:9:108 - error TS2304: Cannot find name 'AsyncGenerator'.

9 export declare function flow<R, Args extends any[]>(generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>): (...args: Args) => CancellablePromise<R>;
                                                                                                             ~~~~~~~~~~~~~~


Found 1 error.

npm ERR! Test failed.  See above for more details.

Downgrade to 4.14.1 fixed the problem.

@vovkasm
Copy link

vovkasm commented Nov 18, 2019

@vonovak Above error because AsyncGenerator defined only in lib.es2018.asyncgenerator.d.ts

@FredyC Does this mean that mobx (even 4.x) can be used only with "lib": ["es2018"] in tsconfig?

@danielkcz
Copy link
Contributor

You are commenting on the wrong PR, this is about FlowType. Please open the new issue instead.

There is a requirement to use TS 3.6 since the last release. Not sure about lib, that might wrong.

@vovkasm
Copy link

vovkasm commented Nov 18, 2019

Thank you! And sorry, not understand that this about flowtype. Just found this ticket with search. Will create distinct bug report.

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

Successfully merging this pull request may close these issues.

3 participants