3 ms·
Question, in the doc it shows a code snipped that has the functioned defined as such "function foo(x: string)" What mechanism ensures this becomes valid javasc
by swalsh 12y ago
Question, in the doc it shows a code snipped that has the functioned defined as such "function foo(x: string)"
What mechanism ensures this becomes valid javascript? does the code need to be compiled?
- jimarcey 12y agoThese should hopefully help you out. http://flowtype.org/docs/existing.html#_ http://flowtype.org/docs/existing.html#_ http://flowtype.org/docs/running.html#_ http://flowtype.org/docs/running.html#_
- jspdown 12y agoIt's ensured by a compilation step. From their website: "Typed Flow code easily transforms down to regular JavaScript"
- inglor 12y agoThis is _not_ valid JavaScript. The code has a build step - yes. You will not be able to run this code without a step. It could be awesome if they allowed annotations in comments like other tools do - there is a GH issue on that and it looks like it should be possible https://github.com/facebook/flow/blob/master/src/typing/comments_js.ml https://github.com/facebook/flow/blob/master/src/typing/comm...