Wun Code
JavaScript

Networking and Data Fetching

Learn to read JSON, wait for the server to respond, and handle loading and failure states. That's what separates a demo from a product people can rely on.

Start the trackFree, no sign-up needed

What you'll learn

  • Reading and writing JSONTurn text into objects
  • Fetching data with awaitAwait the data, then show it
  • The four statesLoading, success, failure and empty results
  • RetryingDon't give up after the first failure
  • Parallel requestsThe slowest request's time, not the total
  • Request timeoutsPut a limit on the wait
  • Aborting stale requestsOnly the latest search's results show up
  • Caching requestsOne request per ID

Track contents

8 lessons, 2 hours in total
  1. 1Reading and writing JSONJavaScriptTurn text into objects
  2. 2Fetching data with awaitJavaScriptAwait the data, then show it
  3. 3The four statesJavaScriptLoading, success, failure and empty results
  4. 4RetryingJavaScriptDon't give up after the first failure
  5. 5Parallel requestsJavaScriptThe slowest request's time, not the total
  6. 6Request timeoutsJavaScriptPut a limit on the wait
  7. 7Aborting stale requestsJavaScriptOnly the latest search's results show up
  8. 8Caching requestsJavaScriptOne request per ID