Live demo: github pages
![ToDo](https://private-user-images.githubusercontent.com/88759292/302461835-8900ae21-e79c-411b-b70f-a969e59a633d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEwNDQwMTcsIm5iZiI6MTcyMTA0MzcxNywicGF0aCI6Ii84ODc1OTI5Mi8zMDI0NjE4MzUtODkwMGFlMjEtZTc5Yy00MTFiLWI3MGYtYTk2OWU1OWE2MzNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE1VDExNDE1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY1YWY1NWRjMDVlOTBhYjMyNDhlYTc2NzkzNGUxMDI4YjczZmI5YmU3ZTA1M2M0M2NlYjlhMzE2ZGRhOTE4ZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nuKP-K4p0ZxHC2uYgpRo4k29PA71Sx87Uk3xlgon4Pg)
Completed as part of The Odin Project Javascript Todo project.
A classic learning project, which I managed to make much more complicated by using it to explore object oriented design.
Frankly the code is much more interesting than the app itself.
I wrote a blog post about my exploration of the singleton pattern and my approach to the project:
The Javascript decorator-singleton pattern... pattern
I decided on the following requirements for my implementation:
- The view should be a function of state
- Messages should pass through the app in one direction
- The Items (Tasks, Categories) should have no insight as to their context (Lists which contain them)
- The Item Lists (TaskList, CategoryList) should have no coupling to their context (the DOM)
This necessitated the use of the observer pattern, so that a DisplayManager could be subscribed to changes in the Lists.
If I come back to the project these are things I would like to tackle:
- Enable Tasks to have multiple Categories, more like tags
- Warn users prior to executing deletion
- Enable sorting of the list
Additionally one downside of having the entire task list or category list re-render on state changes, is I can't get nice animations when things change. Therefore I would like to enable partial re-rendering.
My goal was to focus on the OOD part of the project and make the actual visual implementation as simple as possible.
- Actually the simple nature of the design made for some interesting challenges, especially when considering seperation of concerns and decoupling.
- For example the user can edit the Category name, which has to pass to the Task List renderer and update the category name on each task. For this reason all my objects have a UUID so that they can be referenced by ID rather than name.