Phase 1 project
My project program fulfills the MVP of the project in that there are 3 event listeners: a ‘click’, a ‘submit’, and a ‘DOMContentLoaded’. It mimicks interaction through a db.json file which populates the elements of the DOM. A single [GET] fetch call is used.
I had trouble with the simulated interactivity. My ‘handleResponses()’ function was initially too unreliable, as I was going to require multiple results to elaborate from that single event — one of which is responsible for resetting the DOM in order to allow further functions to happen.
Get Kyrian Onwe’s stories in your inbox
Join Medium for free to get updates from this writer.
In order to resolve the bugs that presented themselves from this and other similar blocks, I decided to manage the different results with their own individual functions. This required deriving out the simplest block to outline a single expected behavior and making the ‘handleResponses()’ an array of functions, resulting in apparently manageable code.
From this project I take away the vital importance of complex and recursive planning BEFORE ever starting to code. Without the algorithm I developed on slips of paper and snippets, this code may never have made me as proud as it has.





