Paginated Fetch

Let's extend the composable API constants so it can deal with paginated data!

We'll cover the following

Take a closer look at the data structure and observe how the Hacker News API returns more than a list of hits. Precisely, it returns a paginated list. The page property, which is 0 in the first response, can be used to fetch more paginated sublists as results. You only need to pass the next page with the same search term to the API.

We’ll start with:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy