7 entries · 14-question quiz
Sending HTTP Requests (e.g. Connecting to a Database)
React ↔ Angular reference. React examples use React 19 + TypeScript. Angular examples use modern Angular (standalone components, signals, HttpClient, httpResource(), @if/@for).
Test yourself
14 questions
- 1How Frontends Talk to a Database
A React (or Angular) app never connects to a database directly. It sends HTTP requests to a backend API, and the backend reads and writes the database.
- 2Fetching Data with
useEffectLoading data when a component appears, by running
fetchinside an effect. - 3Loading and Error States
Tracking whether a request is in progress or has failed, so the UI can show a spinner or an error message.
- 4Moving HTTP Code Out of Components
Putting request logic in a separate module so components only call simple, typed functions.
- 5Sending Data and Optimistic Updates
An optimistic update changes the UI immediately, before the server confirms, and rolls back if the request fails.
- 6Race Conditions and Cancelling Requests
A race condition happens when an older, slower request finishes after a newer one and overwrites its result.
- 7Summary