Getting Started
10 min read
Plan the Task Data
Plan the Task Data
Before writing the application state, decide what one task needs to remember.
Look at both the task card and the form.
A task needs these six values:
id
title
description
priority
status
date
Each value has a specific job:
ididentifies one task.titleis the task name.descriptioncontains additional information.prioritycontrols the priority label.statusdetermines the task’s column.datestores the due date.
The most important relationship for the next module is status.
If a task contains:
status: "progress"
JavaScript will know that the task belongs in the In Progress column.
This gives the application a single piece of data that can decide where the task should appear.
Checkpoint
Write one example task object in your own notes using the six fields above.
Then answer:
Why should the task data store its status instead of using the card’s current DOM location as the source of truth?
Once you can answer that question, Module 1 is complete.