React redux 中的 store、dispatch、payloads、types、actions、connect、thunk、reducer 是什么?

what are store, dispatch, payloads, types, actions, connect, thunk, reducers in react redux?

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

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')
)

很难用一句话回答这个问题。正如一些人指出的那样,教程是一个很好的起点。

这里有一个简短的总结:

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

Dispatch: redux 提供的一个函数,允许你向你的redux发送动作state/reducers.

有效负载:一个动作的contents/message。将其与电子邮件消息进行比较。

Type:发送的动作类型。将其与电子邮件的主题进行比较。

Actions:你告诉 redux 做某事。将其与电子邮件本身进行比较。

Connect: redux 提供的一个函数,允许你将你的 react(或其他 framework/language)组件连接到 redux 状态。

Thunk: 在 redux 中管理异步操作的库。另一个库是 redux sagas。

Reducers:Reducers defines/updates 你的状态和响应发送到 redux 的动作。

很通俗的解释。如果您想要更好的解释,教程是一个更好的起点,当您掌握了基本概念后,您可以 ask/search 在 SO 上提出更具体的问题。

编辑:corrections/improvements欢迎对我的解释