多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 7.1 just [rest](https://github.com/cujojs/rest) 简单,rest 请求回来一个 Promise,你还可以用 [when](https://github.com/cujojs/when) 获得更多的 promise 和 monad 用法。 无需 model 在 componentDidMount 发出 rest 请求,then 直接扔给 setState。最多 setState 前加些 map filter 把数据改改格式。 ## 7.2 [relay/graphql](https://facebook.github.io/relay/) 官方 data fetching 解决方案。 比起由 component 去发请求,再转换数据格式。relay/graphql 的思想是有 component 定义数据形状,由 relay 去发请求,有 graphql server 跟去根据定义返回相应形状的数据。 所以,对,会多一层 server layer。 view 层简单了,graphql 要做的事情却不少。 ## 7.3 [falcor](https://github.com/netflix/falcor) netflix 的简单版的 graphql可以参考我的 [todo falcor](https://github.com/jcouyang/react-falcor) 思想大致相似,但是更为简单一些,没有什么 QL,schema 之类的