Let's understand suspense for data fetching
summary
Demo builds a tiny data layer that uses React 18 Suspense to fetch jokes from a Dev Jokes API, showing three concrete strategies: render‑then‑fetch, fetch‑then‑render (module scope), and render‑as‑you‑fetch. It implements a createResource pattern that reads or throws the promise suspender, adds a 1.2s throttle to make latency visible, and uses useTransition to keep inputs responsive. The hack runs with yarn parcel in a 20‑minute demo and works as shown, but the claim is clear: use libraries in production, this is for learning.
AI-written summary · about
