The extraReducers field in createSlice() lets a slice respond to actions that weren’t defined inside its own reducers. It’s commonly used to handle actions generated by async thunks or actions from other slices.
To handle actions from createAsyncThunk() (like pending, fulfilled, and rejected).
To respond to actions defined in other slices.
To keep reducers modular while still reacting to shared global actions.