ClaudiaRojasSoto / toDo_list

This exercise builds a simple to-do list using WebPack and then serving it with Webpack dev server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repetitive logic in the form submit event on index.js

ClaudiaRojasSoto opened this issue · comments

Excellent code. Good logic. It fulfills its function. However, there is something that I think you can improve:
In the index.js file, in the submit event of the form, you have boilerplate logic to add a task. You can extract that logic into a separate function and call it from both places to avoid code duplication. For example:

https://github.com/ClaudiaRojasSoto/toDo_list/blob/c0fe4e546a3d9c1453fdd14868a4f62e8a582173/src/index.js#LL83C1-L107C4

@ClaudiaRojasSoto