What are Redux actions?
Answer
Actions in Redux are plain JavaScript objects that describe what happened in the application. They must have a type property (a string describing the event) and optionally a payload (the data associated with the action). Example: { type: "todos/todoAdded", payload: { id: 1, text: "Buy milk", completed: false } }. Action creators: functions that return action objects: const addTodo = (text) => ({ type: "todos/todoAdded", payload: { id: uuid(), text } }). Dispatch: store.dispatch(addTodo("Buy milk")). Action type conventions: "feature/action" — the Redux Toolkit naming convention using slices. Actions should describe events that happened (userLoggedIn), not the state change to make (setLoggedIn). This distinction makes actions more useful for debugging and analytics. With Redux Toolkit's createSlice, action creators are generated automatically from reducer definitions.