angelsolaorbaiceta / fe-fwk-book

Learn how frontend frameworks work by building your own. Code for the book "Build a frontend framework from scratch", published by Manning.
http://mng.bz/aM2o
MIT License
120 stars 27 forks source link

Update required for Exercise 2.3 solution #290

Open KOTISWAROOP opened 2 weeks ago

KOTISWAROOP commented 2 weeks ago

Navigate to this link(solution for Exercise 23): https://github.com/angelsolaorbaiceta/fe-fwk-book/wiki/Solution-to-exercises#exercise-23

Code from the page: function removeTodo(index) { -- todos.splice(index, 1) -- todosList.childNodes[index].remove() ++ todos[index].done = true }

In the 'removeTodo' function it is mentioned to only add 'todos[index].done = true' line but this is not giving expected result. we also need to add 'todosList.replaceChild(renderTodoInReadMode(todos[index]),todosList.childNodes[index])' to replace the existing child node with new node that contains the crossed out css.

angelsolaorbaiceta commented 1 week ago

Hi @KOTISWAROOP ,

Thanks for reporting this. I'll take a look as soon as I have time.