Slaying a UI Antipattern
summary
Many sites show empty lists or zeroes while data is actually loading because they use a Boolean loading flag plus an empty collection. The fix is a four‑state model — NotAsked/Loading/Failure/Success — implemented as a RemoteData type in Elm, an HTTP adapter that maps responses into that type, and a reusable webDataView adapter that renders each state. Result: compile‑time guarantees that loading and error UIs are always handled, fewer UX glitches, and consistent, cheap-to-maintain HTTP handling.
AI-written summary · about
chapters (7)
- 0:00The UI loading problem
- 2:55Analyzing the root cause
- 5:13Solving with types
- 9:24The reality of Ajax
- 14:37Implementation walkthrough
- 21:02Results and benefits
- 25:23The importance of data models
related talks
25mLeveraging (algebraic data) types to make your UI rock solid
25mMaking Impossible States Impossible
39mDeveloper Happiness on the Front End with Elm
25mThe State of Data Loading
34mFunctional UIs and Unidirectional Dataflow
27mPut it All in State
25mLeveraging (algebraic data) types to make your UI rock solid
21mAsynchronous UX
