React and Redux

Most important words in Redux architecture:

  • Store
  • Dispatch
  • Actions
  • Reducer
  • State




Reducer is a function that recieves two parameters and returns a piece of the application state.

The first parameter is the current state, and the second is the action

function counter(currentState, action) {
  var DEFAULT_STATE = { count: 0, sum: 0};



Is a function that returns an action. Returns an object with the type property and can return extra data if necessary.


State is an object managed by STATE.

// this will return the state object from store
var state = store.getState();


Container (Smart Component)

Container is a react component that as a direct connection to the state managed by redux.

Share Comments
comments powered by Disqus