GoConqr has a new look! Let us know what you think.

Module 2 of 3 · Text

Redux - The principles of Redux

Tomas Katz

The principles of Redux

  • Single source of truth – all of the different states of different services and components are saved into the store, an object that holds the complete state.
    • Universal apps - This makes it possible to serialize state on server side and pass it to the client with no extra effort, thus making it easy to create universal apps.
    • Easier to debug  - or inspect the application
    • Enables persistence of app state in development – makes for faster development cycles
    • Some functionality becomes trivial to implement -  for example Undo/Redo
  • State is read-only
    • The only way to change state is by emitting actions, an object describing what happened.
    • Since state mutation is centralized, and changes happen one by one in a strict order, there is no subtle race conditions (which change happened first? and which changes are dependent on that change?).
    • Since actions are plain objects they can be logged, stored, serialized for debugging and research.
  • Changes are made with pure functions
    • reducers are just pure functions that take the previous state and an action, and return the next state.

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?