createSlice() is a function provided by Redux Toolkit that simplifies creating Redux logic for a specific feature. It accepts an object with key properties that define the slice's behavior — including its name, initial state, and reducers.
name: A string that identifies the slice and prefixes generated action types.
initialState: Defines the default state for that slice of the store.
reducers: An object containing reducer functions that define how the state changes in response to actions. Action creators are automatically generated from these.
extraReducers (optional): Handles actions defined outside the slice, such as those created by createAsyncThunk or other slices.