CodingNic

Getting Started

Plan the Task Data

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:

text
id
title
description
priority
status
date

Each value has a specific job:

  • id identifies one task.
  • title is the task name.
  • description contains additional information.
  • priority controls the priority label.
  • status determines the task’s column.
  • date stores the due date.

The most important relationship for the next module is status.

If a task contains:

text
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.