- What is AJAX? Async JavaScript and XML
- What is blocking (sync) vs non-blocking code (async)?
- For example, event listeners
- So what would server communication look like since it's async?
- https://www.reddit.com/.json
- Nested callbacks within nested callbacks
- Triangle shape
- Really hard to read and manage
- Built in web api
- Get JSON data
- Returns a promise object
- Practice with: https://animal-farm-api.herokuapp.com/animals
- MDN documentation
- Practice with: http://localhost:300/hello/1
- pending
- fulfilled (resolved/rejected)
- How to unwrap a promise using
.then
- At Flatiron, we will work with promises via Fetch rather than creating our own Promises
.then().then()
- Easier to read, easier to manage
- First FSPs this Friday
- Even if you're not in the first group, start it asap, talk to the coaches