MVI Architecture With Jetpack Compose .
In this article we will be talking about easy implementation of MVI
Architecture
in jetpack compose.
MVI stands for Model , View , Intent
. it is the same as MVVM , only one thing is added , which is Intent
.
Model
It is the place where we write all the business logics , database and network operations.
Remember one thing , whenever you create any applications and you found any business logics ( like validate email , fetch data from network) then without thinking about anything write that logics in Model
file.
it is sometimes called repository .
View
View is the place where we show all the data which is coming from the business logics.
Intent
it’s nothing , just a ViewModel
, but here we deal with events and states.
Suppose i want to fetch some data from the server, so first i will speak with server that i want these type of data.
Speaking with server === Events
Yes right speaking with server is your events
. So your event is fired after that server will respond.
Responding from server === States