Reducers decide how your Redux state changes when something happens.
A reducer is responsible for describing how state should change in response to an action. For example, when a user logs in, a reducer might store the user's information in Redux state. Reducers receive the current state and an action and produce the next state.
Redux Toolkit makes reducers easier to write by using Immer internally. This means you can write code that looks like it is directly changing the state, such as state.count++, while Redux Toolkit safely produces the immutable state update behind the scenes.
What you'll walk away knowing