[Flow] The Fundamentals of Flow

Install:

yarn global add flow-typed /*get type defination*/
yarn add flow-bin -D

For example you have installed lodash libaray, and you want the defination file also, you can do:

flow-typed install

It will help to install the files automaticlly.

If you running flow with Node.js, the syatax:

const result: number = _.min([,1,2]);

cannot be understand by node.js.

You can do:

const result/* :number*/ = _.min([1,2])

or you can use Babel.

原文地址:https://www.cnblogs.com/Answer1215/p/6476515.html