Skip to content

Conversation

@sjlee3157
Copy link

@sjlee3157 sjlee3157 commented Nov 27, 2018

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? You can multitask! For example, with HTTP requests in JavaScript, you can make a request without pausing everything to make it. Instead, you make the request and continue executing code, make another request at the same time, or continue listening for events. The request is executed through another process which returns a response or a promise (Axios) once it's done, which I think is vaguely like a response object which you wait for and then can interact with using chainable method calls that it responds to.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? The Axios requests and event handlers all execute asynchronously. I guess the effect on the code is that we use callback functions (or promises, with Axios) to handle the response/promise, instead of just listing code in "steps" the way we did in, say, our early Ruby programming.
What kind of errors might the API give you? How did you choose to handle them? An example is a bad POST request to make a reservation. The API will respond with a status code 400 and a hash of problems. I did three things to handle the error: 1) catch the exception in the Axios response (promise), 2) console.log the error to the browser console, and 3) display a parsed error message in the browser HTML.
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. If all the ids are consecutive without gaps, I think so? I could use an nth-child selector with jQuery?

@dHelmgren
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good
Comprehension questions Good
Functionality
Click a button to load and view a list of trips Yes
Click a trip to load and view trip details yes
Fill out a form to reserve a spot yes
Errors are reported to the user yes
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap yes, love the theme. :)
Under the Hood
Trip data is retrieved using from the API yes
JavaScript is well-organized and easy to read yes
HTML is semantic yes
Overall Excellent job overall! This code is for the most part well-organized and easy to read, and it's clear the learning goals of this assignment were met. I especially appreciate the care you put into error handling.

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.

2 participants