ScreenState
The one UI state an offline-first screen renders. Collapses the usual scatter of isLoading / isFromCache / isRefreshing / error / networkStatus flags into a single exhaustive type a when can render. Produced by DecisionEngine.decide from a StoreData snapshot + Connectivity.
Original implementation of the offline-first screen-state pattern — the concept is a common one; this is a clean-room, dependency-free take (no Store5, no HTTP client) for the MIT toolkit.
Inheritors
Types
Data to show, with freshness metadata. isRefreshing drives a background-refresh indicator.
A fetch completed but returned no content (e.g. an empty list).
Initial load — nothing to show yet.
Offline with no cached data. isCaptivePortal is true behind a hotel/airport WiFi login wall.
Auth required (401/403 / token expiry) with no usable cache — send the user to sign-in.