Problem Statement
Describe a pattern to show loading and error states while fetching data.
Explanation
Maintain three pieces of state — loading, data, and error.
Start with loading = true, then update data or error once the request resolves or fails. This pattern helps render conditional UI feedback for users.