"DATA FETCHING IN REACT"
summary
Argues for separating rendering from fetching by using a reusable withData higher‑order component and a single data store that subscribes to queries, caches results, merges requests to avoid N+1 fetches, and publishes updates. Shows a Node.js-backed prototype called Bicycle plus a Relay/GraphQL alternative; Bicycle demo implements subscribe/unsubscribe, caching, batched fetches, optimistic updates that roll back on error, and a crude 3s refresh — prototype works in demo but is not production‑battle‑tested.
AI-written summary · about
chapters (24)
- 0:00Intro
- 0:15Components
- 0:56Data Flow Example
- 2:55Code Walkthrough
- 4:53Story Component
- 6:09Component Differences
- 6:44Higherorder Components
- 7:49Higherorder Component
- 8:25Data Fetching
- 9:42App Component
- 10:12Story
- 10:25URL
- 11:03Common concerns
- 12:19Updating
- 13:16Data Store
- 16:34API
- 17:17Update Methods
- 18:14Datastore
- 20:13Demo
- 26:00Bicycle
- 27:06Bicycle Code
- 31:47Relay Code
- 32:59Build your own data store
- 33:38Conclusions
