-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Flow type annotations #87
Conversation
Everything is I like this. Want to see more :-) |
@gaearon Haha, that's a good thing in this case! Not making any assumptions about action or state types :) |
@gaearon How about this: I'll create a |
I like this. |
Still can't figure out how to use union types to implement function overloading. |
I haven't tested this...but have you guys considered running the code base through babel first (and blacklisting flow so that it keeps the types) and then running it through the flow type checker? If that worked; it would allow all ES2015+ features to stay and still get the benefits of type checking. |
Looks like this guy is doing it http://www.keendevelopment.ch/flow-babel-gulp-es6/ |
Why did you convert |
See the first post:
Although it may be possible to do it some another way: |
I'm kind of stuck on this PR until someone can explain to me how to properly use union types to implement function overloading. Any Flow experts out there? |
I am not very familiar with Flow, but the issue is being caused by this line in createDispatcher.
If you take out dispatch, it stops complaining. I am not sure this is an issue with function overloading, but I am having a hard time figuring out what it wants. I noticed #166 will conflict with this pull request. The issue may be solved because the createDispatcher function is being removed. Do you want me to take this over or would you like to continue? I can fix the code conflicted, add the code not covered in 166 and resubmit. |
We should probably wait until 1.0 when the API is stable. After that, feel free! |
Here's a way to run Flow when files change... very useful when tweaking the config, fast feedback loop.
|
@acdlite About function overloading - http://flowtype.org/docs/union-intersection-types.html you can use intersections ( // Intersections are well-suited to mimic function overloading.
declare var f: ((x: number) => void) & ((x: string) => void); |
Superseded by #87. |
Whoops, inception! I meant by #254. |
Opening this PR to track adding Flow annotations. So far I've completed Redux.js. Looks like the biggest thing we'll have to give up is
const
, as Flow supports neither that norlet
. I think that trade off is worth it.We'll also want to integrate Flow into our automated tests.
Prior to this my experience with Flow was the "Hello, World!" example on their website, so if I do something wrong please let me know :)
Addresses #83.