In this section, we'll start by going through the three principles in Redux and then dive into the core concepts.
Let's take a look at the three principles of Redux:
- Single source of truth: This means that the whole application state is stored in a single object. In a real app, this object is likely to contain a complex tree of nested objects.
- State is read-only: This means that state can't be directly changed. This is a bit like saying we can't directly change the state within a component. In Redux, the only way to change state is to dispatch what's called an action.
- Changes are made with pure functions: The functions that are responsible for changing the state...