Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactmvc 的若干想法 #19

Open
ustccjw opened this issue Jan 12, 2017 · 0 comments
Open

reactmvc 的若干想法 #19

ustccjw opened this issue Jan 12, 2017 · 0 comments
Labels

Comments

@ustccjw
Copy link
Owner

ustccjw commented Jan 12, 2017

初步的想法主要是引入 observable 数据推送的概念。

  • reactmvc 专注于构建 React App。

  • model 使用 observable 封装: uiModel observable(UI 操作),dataModel observable(服务端数据推送如:websocket 等)。uiModel 和 dataModel 是可序列化对象,在绝大多数情况下只有 uiModel。

  • 任何 action 都生成新的 uiModel,从而 model observable 产生新的 model 推送。

  • 每个路由对应一个 observable,提供这个路由页面整个生命周期的数据(从 root 更新)。这个 observable 接受 model observable 推送的 model,来生成页面所需要的数据,注意是 observable,所以可以灵活的推送数据,非常有利于性能优化。

  • 废弃服务端数据模型(非服务端推送数据)。一般应用的数据接口大多是 restful 接口,服务端数据层接口需要提供:数据缓存和数据清空。

@ustccjw ustccjw added the think label Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant