Skip to content

Instantly share code, notes, and snippets.

@khalidwilliams
Created June 30, 2020 20:03
Show Gist options
  • Save khalidwilliams/35f8acce055953b1d5ac3839ddb1c2dc to your computer and use it in GitHub Desktop.
Save khalidwilliams/35f8acce055953b1d5ac3839ddb1c2dc to your computer and use it in GitHub Desktop.

Take 10 minutes to research the following in breakout groups. When you get back, I'm gonna call on some people to answer and explain.

1. What does the fetch api do?
2. What does .fetch() return?
3. What does .then() do? What is the method called on? What does it return?
4. What does .catch() do? What is the method called on? What does it return?

And tackle this diagram:

someAsyncFunction() // What does this return?
	.then( (1) ) // When does this run? What does it return
	.then( (2) ) // When does this run? What does it return?
	.catch( (3) ) // When does this run? What does it return?
// What goes in place of (1), (2), and (3)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment