Example of a Reducer
Let’s explore what a Reducer is in NgRx.
We'll cover the following...
What is a Reducer?
Reducers handle the functionality where we go from one State to the next.
A Reducer doesn’t implement an interface as the Action does, but it does return a State object. The Reducer function takes in two arguments, that is, the State and the Action.
Example
For our Managing Apples example, a Reducer could look as follows:
First, we define the interface of our State model in ...