What is Redux?

  • Model: It includes all the data and its related logic
  • View: Present data to the user or handles user interaction
  • Controller: An interface between Model and View components
  • Single source of truth:
    The state of your whole application is stored in an object tree inside a single-store.
    The data modification must be done by ‘reducer’ and the data saves in ‘store’. In React, the parent-component passes the data or the state to the child-component but this data will always be stored. You may create ‘store’ more than one in any circumstances or needs but be aware of creating lots of ‘stores’. Then there’s no merit using Redux.
  • State is read-only:
    The only way to mutate the state is to emit an action, an object describing what happened.
    Since ‘state’ is read-only, individuals may not be able to modify any ‘state’ that’s happening through ‘view’. Data modification has to be done only by ‘reducer’.
  • Mutations are written as pure functions:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store