State Management · Junior · Question 13 of 75

Why name actions after what happened ('task_added') rather than what to do ('set_tasks')?

Explanation

An action describes a user event ("a task was added"), and the reducer decides how state reacts. set_* actions push the logic back into components and turn the reducer into a dumb setter. The same convention is used in Redux.

Further reading

Problem with a question

State Management · Junior · question 13

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz