Reducers are pure functions in redux which are used
to modify the state object of the Application. All Actions are handled in
reducers they will get the payload from the action and modify the state as
defined.
Reducers take the previous state of the app and return a new state based on the action passed to it.
Reducers take the previous state of the app and return a new state based on the action passed to it.
As pure functions, they do not change the data in the object passed to
them or perform any side effect in the application. Given the same object, they
should always produce the same result. Actions performed on the state always
return a new state. Thus, the state is very easy and predictable.
In the previous post, we was a SET_NAME action below is the reducer which handles the SET_NAME action.
In the previous post, we was a SET_NAME action below is the reducer which handles the SET_NAME action.

