Typical Asynchronous Action Example

Interactively visualize asynchronous code execution using a code example that fetches data from GitHub.

Fetching GithHub data asynchronously

Many applications working with APIs inform the user that data is loading while it’s being fetched from the API. Loading spinners or text such as “Loading data…” are common ways of conveying this information. Thunk actions are a great way to cover this case using a reducer.

Note: For the SPA widgets in this lesson, you’ll need to open the web inspector to view the app response. Click the link given below the widget to open the app in a new browser tab. Then, right-click that webpage and select “Inspect.” The web inspector will open, where you can go in the “Console” tab and see the app response.

Get hands-on with 1200+ tech skills courses.