MVI
Also called: Model-View-Intent, Redux-style architecture
Model-View-Intent: the screen has one immutable state; the view sends intents, and a reducer computes the next state.
Definition
In MVI, every user action or result becomes an intent, a pure reducer turns (state, intent) into the next state, and side effects like network calls run outside the reducer and send their results back as intents. Data flows in one direction, which makes changes easy to trace and test. One-off events such as toasts and navigation need special handling so they are not replayed.
In practice
reduce(state, LogInTapped) returns the same state with isLoading = true; the store then starts the login call.
Related terms
- MVVMModel-View-ViewModel: the UI observes a ViewModel that holds screen state and logic, separate from the UI code.
- Unidirectional data flowAn architecture rule where state flows down from one owner to the UI, and user actions flow back up as events.
- State machineA model where something is always in exactly one of a fixed set of states, and events move it from one state to another by explicit rules.