The reducer function is a pure function without any side-effects, which means that given the same input (e.g. state and action ), the expected output (e.g. newState ) will always be the same. This makes reducer functions the perfect fit for reasoning about state changes and testing them in isolation
Reducers are pure functions in that they produce the same output for a given input. They are without side effects and handle each state transition synchronously. Each reducer function takes the latest Action dispatched, the current state, and determines whether to return a newly modified state or the original state.
The reason why a redux reducer is called a reducer is because you could "reduce" a collection of actions and an initial state (of the store) on which to perform these actions to get the resulting final state . The reducer is a pure function that takes the current state and an action, and returns the next state.