Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
React Native
0/50 solved · 0%
All lessons
lesson
code
Networking · easy
11. Loading/data/error state
Model the three states of a fetch.
Write `fetchState(loading, data, error)` returning `"loading"`, `"error"` or `"success"` based on priority: loading first, then error, then success.
Required in your answer:
if (
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
function fetchState(loading, data, error) { // TODO }
Output appears here.
← 10. Namespacing storage keys
12. Context default value →