How to write your own MVI library and why you shouldn't
summary
Shows a working MVI implementation using Kotlin Coroutines that fits under ~30 lines: state exposed with MutableStateFlow, intents as direct viewmodel methods, reducers run on a single-thread context, and one-off navigation via a buffered Channel exposed as a Flow. Demo loads a list of posts and navigates successfully. Claims this minimalist container lacks DSL scoping, process-death safe state, idling-resource and testing helpers, and recommends using their full library Orbit which adds those missing features and test tooling.
AI-written summary · about
chapters (21)
- 0:00Introduction to MVI
- 2:19Key MVI concepts
- 3:49Why not write your own
- 5:19Choosing Coroutines
- 6:00Live coding the framework
- 7:26Defining the state
- 9:41Rendering the state
- 11:09Handling intents
- 12:54Updating state safely
- 14:39Refactoring reduce function
- 16:05Adding navigation
- 18:35Introducing side effects
- 21:46Refactoring side effects
- 22:48Creating intent function
- 24:14Listening to side effects
- 25:40Extracting the container
- 28:12Making it generic
- 30:20Final demo and code
- 30:41Should you write your own?
- 31:47Introducing Orbit library
- 33:33Q&A session
related talks
36mSimple MVI Architecture for Android
03mInterview with Gema Socorro
36mSimple MVI Architecture for Android
58mHow to cook a well-done MVI for Android
29mModern Android Development using MVI architecture
34mMVWTF: Demystifying Architecture Patterns
18mMVI made for Android
38mHands On MvRx: Building Real Apps
