Skip to content

Can someone please share an example of how to use @flow with typescript? #2556

Answered by kubk
suparngp asked this question in Q&A
Discussion options

You must be logged in to vote

There are a lot of problems with generators in TypeScript. Basically, TypeScript can't infer the type of yield expressions in such simple cases:

const foo = yield 1; // variable foo has type 'any' instead of 'number' 

Here is the open issue: microsoft/TypeScript#32523
Currently, generators in TypeScript aren't type-safe and not very convenient to use. Mobx can't fix that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by suparngp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants