...

/

Asynchronous Data Retrieval

Asynchronous Data Retrieval

Learn how to dynamically fetch data for applications using asynchronous data retrieval.

We'll cover the following...

Imagine for a second that we’re asked to build the website for the Library of Trinity College in Dublin, one of the most famous libraries in the world. It has about 300 years of history and about 7 million books. Ok, now let’s imagine we have to allow the users to browse this massive collection of books. Yes, all 7 million of them… a simple data file isn’t going to be a great idea here!

A better approach would be to have a dedicated API to retrieve the data about the books and use it to dynamically fetch only the minimum amount of data needed to render a given page. More data will be fetched as the user navigates through the various pages of the website.

Using API to retrieve data

This approach is valid for most web applications, so let’s try to apply the same principle to our demo application. We’ll be using an API with two endpoints:

  • /api/authors (to get the list of
...