01 / 03
A screen has four states
An app that fetches data has four possible states for its screen.
- loading — waiting ("hang on…")
- success — data arrived (show the list)
- empty — data arrived but there is nothing (show "nothing here yet")
- error — it failed ("try again")
TypeScript can write all four as a type.