Skip to content

Instantly share code, notes, and snippets.

@bernardodiasc
Last active March 3, 2016 23:52
Show Gist options
  • Select an option

  • Save bernardodiasc/2106af0611b3d8d12906 to your computer and use it in GitHub Desktop.

Select an option

Save bernardodiasc/2106af0611b3d8d12906 to your computer and use it in GitHub Desktop.
Redux short review

Redux

action -> reducer -> container -> view

Redux is an improvement over Flux architecture, the goal is provide a life cycle for the application. It is data driven with few templates with well defined purposes.

  • actions: action dispatch data changes triggered from view
  • reducer: receive action result and change data state (createStore(reducers))
  • container: it’s same as view component used differently, this component connects with store using redux lib (connect()(component)), usually contain view components for presentation
  • view: react to state changes and update markup, this is the react lib, also trigger actions (dispatch(action))

Notes

  • helps debug techniques with hot reloading
  • snapshot of states with immutability
  • can use relay to connect with db and handle data with graphql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment