Milestone 2: add, edit, move and delete with a reducer
The components already dispatch actions through context, but tasksReducer ignores them. Write the four cases so the board works.
added adds { id, title, status: "todo", priority: "medium" } at the end; edited changes a title; moved changes a status; deleted removes a task. Never change the old array or task objects: return new ones.
The page uses: the input #new-title (label New task) with an Add button, and buttons labelled Move <title> left, Move <title> right, Edit <title> and Delete <title> on each card. Editing shows an input labelled New title for <title>; Enter saves.
What Check tests
- Adding
Ship itputs it in To do - An empty title adds nothing
- Move right sends
Add a reducerto Doing - Editing renames
Plan the boardtoPlan v2 - Delete removes
Ship it - The reducer copies instead of changing the array
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Your page
Console
Nothing logged yet.