Skip to content

Ports - Kim#34

Open
Kimberly-Fasbender wants to merge 24 commits intoAda-C11:masterfrom
Kimberly-Fasbender:master
Open

Ports - Kim#34
Kimberly-Fasbender wants to merge 24 commits intoAda-C11:masterfrom
Kimberly-Fasbender:master

Conversation

@Kimberly-Fasbender
Copy link

@Kimberly-Fasbender Kimberly-Fasbender commented Jun 3, 2019

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? It means that code does not need to execute in order, and that many things can be executing at once. It also means that you can still interact with a web page while waiting for a request/response without the page freezing.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? Axios API calls are asynchronous, so any code that is written after a call can be executed while the call is being made. When posting a reservation for a trip, I made sure to save the form input in a variable (reserveData) because after the Post API call I clear the input values for the form. If I didn't save that data in a variable, it's possible it could be cleared before the API post was complete, causing an error.
What kind of errors might the API give you? How did you choose to handle them? The API could give you status errors for a bad request (400), or potentially for a trip that no longer exists (if something happened and a trip was removed from the list after someone loaded it). I chose to handle the errors by parsing the error response messages and displaying them nicely at the top of the browser.
Suppose you needed to routinely find a specific Trip in the list by it's ID field. Would it be advantageous to keep the list in order by the id field? Explain why or why not. No, it would not be advantageous to store them in order, because looking them up by id # would take constant time so order will not matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant