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

项目结构详解 #47

Open
hsipeng opened this issue May 10, 2018 · 0 comments
Open

项目结构详解 #47

hsipeng opened this issue May 10, 2018 · 0 comments
Labels

Comments

@hsipeng
Copy link
Owner

hsipeng commented May 10, 2018

主要备忘,同时浅析项目结构,和实际项目中的一些应用和写法。

React 开发框架

结构图:

依赖

配置

  • webpack
  • babel
  • eslint
  • flow
  • ….

开发目录

  • assets
  • components
  • frame

redux

actions

创建各个 action 导出 action 名称,action type 和 action handler。

reducers

封装各个action 和 state

store

  • createStore
    初始化store
  • middlewares
    中间件

router

路由

utils

  • cookie 处理

  • ajax 数据请求封装

  • logger 配置

  • ConnectDecorator
    将组件转成高阶组件包裹connect

  • AsyncLoadingDecorator
    按需异步加载装饰器
    react-loadable

  • createReducer
    创建reducer

  • view

  • index.js

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