Why are Redux state functions called as reducers?

Technology CommunityCategory: ReduxWhy are Redux state functions called as reducers?
VietMX Staff asked 3 years ago

Reducers always return the accumulation of the state (based on all previous and current actions) not only default values. Therefore, they act as a reducer of state. Each time a redux reducer is called, the state is passed in with the action (state, action). This state is then reduced (or accumulated) based on the action, and then the next state is returned. i.e, 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.