Sandbox demo

Connecting to a REST API

Fetch + caching + revalidation patterns that don't blow up your battery.

Native fetch works great. The wrinkle on mobile is caching: hit the network on every screen and you'll burn battery and data. Pair fetch with a small cache layer (or use react-query) and revalidate strategically — when the screen mounts, when the user pulls to refresh, when network reconnects.

Sandbox transcript
Codex · sandbox replay
Press Play to replay this transcript step-by-step.
0 / 8

The transcript is canned — no real API calls. The point is to internalize the loop: user → plan → tool → result → answer.

Check your understanding
Q1. Why is unconditional fetch-on-mount a battery problem on mobile?
· Score 100% on the quiz.