Blog30.6K views1,241 votes0 replies2,512 following
Modeling UI State with Kotlin Sealed Interfaces: Let the Compiler Catch Your Missing Cases
Nullable data/error field pairs silently break when a new state is added. Kotlin sealed interfaces make the set of states closed, so the compiler flags every when that misses a case.