Skip to content

ITP_LONDON | PRISCILLA_EMEBO | Module-Data-Groups | Todo-list #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Priscilla-EM
Copy link

@Priscilla-EM Priscilla-EM commented Apr 21, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@Priscilla-EM Priscilla-EM added the Needs Review Participant to add when requesting review label Apr 21, 2025
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

checkIcon.style.cursor = "pointer";
checkIcon.addEventListener("click", () => {
todo.completed = !todo.completed;
li.style.textDecoration = todo.completed ? "line-through" : "none";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just call populateTodoList() to update the view (to avoid maintaining two sets of code to change view).

trashIcon.className = "fa fa-trash ms-2";
trashIcon.style.cursor = "pointer";
trashIcon.addEventListener("click", () => {
todos.splice(todos.indexOf(todo), 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better performance (i.e., without the need to search for todo in the array), we could make available the index of the current todo at line 11 as

   todos.forEach((todo, index) => {

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Apr 21, 2025
@cjyuan
Copy link

cjyuan commented Apr 21, 2025

On separate note, it is a good practice to give a brief description to every PR.

image

@Priscilla-EM
Copy link
Author

Thank you very much. I'll make the necessary changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants