Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active April 10, 2018 16:15
Show Gist options
  • Save rogerwschmidt/06ff3add54e5d6cce87ceba2c36bd428 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/06ff3add54e5d6cce87ceba2c36bd428 to your computer and use it in GitHub Desktop.

Ajax and promises instructor notes

Objectives

  • Trace the request/response cycle
  • Explain how asynchronous behavior occurs in the request/response cycle
  • Write ajax requests
  • Explain the two promise methods, and how to use them

What is the path of the request/response cycle

  • Clone the following repo -> https://github.com/rogerwschmidt/ajax-promise
  • Start the front end and back end servers
  • With your table follow the Get All route from the front end, to the back end, and back to the front end.
  • With your table follow the Get One route from the front end, to the back end, and back to the front end.
  • Be prepared to present your summary to the class.

Explain how asynchronous behavior occurs in the request/response cycle

  • With your table, pinpoint where the async behavior is happening in the frontend

Write ajax requests

  • In groups of 2, using the pattern that you have studied, create the Get All route for dogs.
  • In groups of 2, using the pattern that you have studied, create the Get One route for dogs.

Explain the two promise methods, and how to use them

  • On your slates, write the three possible states of a promise.
  • On your slates, write what method get triggered on each of the actionable states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment