August 2017
Beginner
374 pages
10h 41m
English
After successfully pulling all posts from the API into our Redux store, we can almost display the main page. However, we still need to resolve the usernames from the posts to user objects.
We could pull users the same way we pulled posts; that is, by pulling all users into the Redux store. However, this approach will get problematic as our application scales. Imagine our blog having over 1000 users, but only a handful of them actually writing blog posts.
To solve this issue, we only pull the user objects we need to display the posts. After pulling all the posts, we iterate over the post objects and request the user objects for all usernames that appear in the posts.
Read now
Unlock full access