For the HTTP project, we were tasked with learning how to use two APIs using fetch and write asynchronous code.
The below screenshot shows a function that gets a list of breeds from a dog API that we later then use to match with github user names using Github's API.
With the above, we use it as a callback in a function later on when sorting through a list of breed names.
During this section of the skills bootcamp, we were working on Execute Programmes' course on concurrency which has a very different interface for using promises. Because of this, it definitely made us question if we were using promises correctly as our code didn't look the same as it did on the programme.
We used the fetch method to get the initial list of dog breeds and images. We then used the fetch method to check if specific github usernames existed to cross reference them against the list of dog breeds.
We used map to reshape the list of dog breeds so that we could use them in a drop down further down the page when a user can create a new github username.
We used the filter method to match github usernames to a breed based on the first character of the string.
We used many different ways of selecting dom nodes in order to add and remove information off of the page. However, we definitely had a preference for 'getElementbyId'
As with the above, we used getElementById to access the majority of nodes, createElement and innerText to add nodes to the page.
We relied on CSS for this and didn't toggle classes using the DOM. However, if we had we would have used setAttribute to make this happen.
For this project we focussed more on trying to learn about promises and leaned on the learning outcomes to guide us. We did not spend a bulk of time on the layout but we tried to use a wireframe ahead of time in order to have a clear picture of what we wanted to end up with at the end.
My working partner added in stacks in CSS to make sure that spacing was even throughout the page.
While working on this project we continually used console.log() and catches to help us debug our code.