Controlling state with reducers
The flagship concept of Redux is that, state is controlled by reducer functions. In this section, we'll get you caught up on what reducers are, followed by the implementation of reducer functions in your Snapterest app.
What are reducers?
Reducers are functions that take a data collection, such as an object or an array, and return a new collection. The returned collection can have the same data in it, or it can have completely different data than the initial collection. In Redux applications, reducer functions take a slice of state, and return a new slice of state. That's it! You've just learned the crux of the Redux architecture. Now let's see reducer functions in action.
Reducer functions in Redux applications can ...
Get React 16 Essentials - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.