-5

what are store, dispatch, payloads, types, actions, connect, thunk, reducers 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')
)
Ashh
  • 44,693
  • 14
  • 105
  • 132
  • Have you ever read the documentation http://redux.js.org/ – CodinCat Apr 06 '17 at 06:05
  • 1
    It seems that you have begun to play with [Redux since February at least](https://stackoverflow.com/questions/42346248/uncaught-error-actions-must-be-plain-objects-use-custom-middleware-for-async-a). I suggest you to make step-by-step tutorial if you want to learn – Damien Leroux Apr 06 '17 at 06:13
  • 1
    This could help you understand: [getting-started-with-redux](https://egghead.io/courses/getting-started-with-redux). Besides, your question is inappropriate for stackoverflow. Use stackoverflow to get help on a specific problem. Not for too broad questions – Damien Leroux Apr 06 '17 at 06:29

1 Answers1

9

Kind of difficult to answer this question in one sentence. A tutorial is a good place to start as some people pointed out.

Here's a quick summary anyways:

Store: holds the state of your redux application

Dispatch: a function provided by redux to allow you to send actions to your redux state/reducers.

Payloads: The contents/message of an action. Compare it to the message of an email.

Type: The type of action being sent. Compare it to the subject of an email.

Actions: You telling redux to do something. Compare it to the email itself.

Connect: A function provided by redux which allows you to connect your react (or other framework/language) components to the redux state.

Thunk: Lib for managing async operations in redux. Another lib is redux sagas.

Reducers: Reducers defines/updates your state and responds to actions being sent to redux.

Very laymanish explanation. If you want better explanations, a tutorial is a better place to start and when you grasp the basic concepts you can ask/search more specific questions here on SO.

Edit: corrections/improvements to my explanations are welcome

Willy G
  • 1,172
  • 1
  • 12
  • 26