zhorabay / Awesome-books

In this project, I structured Awesome books app code which adds/remove books from the list.
https://zhorabay.github.io/Awesome-books/
MIT License
1 stars 0 forks source link

Peer to peer code review #2

Open zhorabay opened 1 year ago

zhorabay commented 1 year ago

Contributions, issues, and feature requests are welcome!

sagieramos commented 1 year ago

Nice job. You've really done well :clap:

But there are some performance issues you might want to improved. You use seperate event listener for different "submit" trigger. One for window, the other for #book-list Screenshot from 2023-08-10 08-23-00 Consider using event delegation for handling events on dynamically added elements. Instead of attaching event listeners to individual elements, you can attach a single event listener to a common parent element (like the book list) and then use event.target to determine the clicked element. This can lead to better performance, especially if you're adding/removing multiple book items dynamically.