什么是存储,调度,有效负载,类型,操作,连接,thunk,reducer在react redux?

Ash*_*shh -5 reactjs react-redux

什么是存储,调度,有效负载,类型,动作,连接,thunk,reducer in react redux ??

import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
const createStoreWithMiddleware = applyMiddleware(thunk)(createStore)
const store = createStoreWithMiddleware(reducer)
ReactDOM.render(
 <MuiThemeProvider muiTheme={muiTheme}>
   <Provider store={store}>
       <Router history={ browserHistory }>
         <Route path="/" component={ Content }/>
         <Route path="/filter" component={ Filter }/>
         <Route path="/details" component={ Details }/>
       </Router>
   </Provider>
 </MuiThemeProvider>,
   document.getElementById('root')
)
Run Code Online (Sandbox Code Playgroud)

Wil*_*y G 6

用一句话很难回答这个问题.有些人指出,教程是一个很好的起点.

无论如何,这是一个快速摘要:

Store:保存redux应用程序的状态

Dispatch:redux提供的一个函数,允许您将动作发送到redux状态/ reducer.

有效负载:动作的内容/消息.将其与电子邮件的消息进行比较.

类型:正在发送的操作类型.将其与电子邮件的主题进行比较.

行动:你告诉redux要做点什么.将它与电子邮件本身进行比较.

Connect:redux提供的函数,允许您将react(或其他框架/语言)组件连接到redux状态.

Thunk:Lib用于管理redux中的异步操作.另一个lib是redux sagas.

Reducers:Reducers定义/更新您的状态并响应发送到redux的操作.

非常苛刻的解释.如果您想要更好的解释,教程是一个更好的起点,当您掌握基本概念时,您可以在SO上询问/搜索更具体的问题.

编辑:欢迎对我的解释进行更正/改进