Skip to content

reactmvc 的若干想法 #19

Description

@ustccjw

初步的想法主要是引入 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 接口,服务端数据层接口需要提供:数据缓存和数据清空。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions