Conversation
|
Hi @Bjeaurn. This feature is not unique to Flow, as TypeScript has an equivalent (and even more advanced/useful): I'd happily accept a description/comparison of both features into the readme. |
This kind of comments make this project lose all its credibility, just FYI |
|
Is the comment inaccurate? If so, you could elaborate |
|
They do the same thing |
|
They don't do the same thing @FezVrasta. You can't use Below is one really useful example taken from the TypeScript's library definition ( interface Array<T> {
filter<S extends T>(callbackfn: (value: T, index: number) => value is S): S[];
}This makes is possible refine the type of an Array by filtering it. You can't model this with Additionally, I apologize for not being clear in my first comment, but my intention is completeness, not bias against any of the two technologies. |
|
How can you say the The Flow definition seems way more accurate, since it allows to return |
|
That's not the meaning of The difference is in the fact that such defined Here's an example comparing the two in respective playgrounds: TypeScript vs Flow All in all,
The two reasons above make TypeScript's |
No description provided.