Problem Statement
What is the purpose of createAction() in RTK?
Explanation
createAction is a helper function that generates an action creator for the given action type string, returning a function that takes a payload and returns a formatted action object. While createSlice handles this automatically for slice reducers, createAction is useful when you need standalone action creators or want to share actions across multiple slices. It ensures consistent action object structure and reduces boilerplate.
