In Redux, a reducer is a function that takes in your application's state and relevant information passed to it from an action, and then returns one single reduced value for your application's state after executing the code.
Reducers should, as a good practice, be restricted to one reducer per file, for clarity.
There are two really important things we need to know about reducers with Redux:
- Your application state is never mutated. Instead, a copy is returned with any changed values.
- Since each reducer ...