【发布时间】:2019-04-30 01:29:56
【问题描述】:
只是想收集一些关于如何在 react + redux 项目中组织 flowtype 的意见。这里有一些示例项目结构:
actions
-> UserAction.js ---> has some flowtype definition related to this action
-> PostAction.js ---> has some flowtype definition related to this action
...
reducers
-> UserReducer.js ---> has some flowtype definition related to this reducer
-> PostReducer.js ---> has some flowtype definition related to this reducer
...
models
-> User.js ---> has some flowtype definition related to this model
-> Post.js ---> has some flowtype definition related to this model
...
components
containers
但是,我看到一些开源项目,例如 f8 是使用单个文件来定义所有类型,例如:
actions
-> UserAction.js
-> PostAction.js
-> types.js --> all types related to actions
...
reducers
-> UserReducer.js
-> PostReducer.js
-> types.js --> all types related to reducers
...
models
-> User.js --->
-> Post.js --->
-> types.js --> all types related to models
...
components
containers
因此,我只是想就如何以更可持续和可读的方式组织flowtype 获得意见。谢谢
【问题讨论】:
标签: reactjs react-native redux flowtype