Problem Statement
Explain how createSlice works and what it returns.
Explanation
createSlice accepts an object with a slice name, initial state, and reducer functions, and automatically generates a slice object containing the reducer function and corresponding action creators based on the reducer names. When you define reducers in createSlice, it uses the function names as action types prefixed with the slice name, so a counter slice with increment reducer creates a counter/increment action type. The returned object contains the reducer to add to your store, the actions object with all generated action creators, and additional properties like caseReducers and getInitialState for advanced use cases.
