Hakob Astvacatryan
01/30/2020, 10:04 PMTash
01/30/2020, 10:06 PMLiveData
as smaller groupings. For example: keep just one/two LiveData
that handles high-level state in the ViewModel
. Then, map the main LiveData
into more specific chunks of LiveData
. Such mapping is better suited to some other “helper” component that you can use in the ViewModel
. This will move out a lot of detail from the ViewModel
Anastasia Finogenova
01/30/2020, 11:56 PMJason
01/31/2020, 5:06 AMhogehogeViewState.kt
to managed all of Livedata .
Basically , the purpose of this separating is that easy to management and easy for testing .ursus
01/31/2020, 2:13 PMAnastasia Finogenova
01/31/2020, 2:21 PMHakob Astvacatryan
01/31/2020, 2:34 PMursus
01/31/2020, 2:36 PMursus
01/31/2020, 2:36 PMHakob Astvacatryan
01/31/2020, 2:36 PMursus
01/31/2020, 2:37 PMursus
01/31/2020, 2:38 PMursus
01/31/2020, 2:38 PMHitender Pannu
01/31/2020, 3:43 PMIanmedeiros
01/31/2020, 4:01 PMIanmedeiros
01/31/2020, 4:03 PMIanmedeiros
01/31/2020, 4:13 PMIanmedeiros
01/31/2020, 4:13 PMHitender Pannu
01/31/2020, 4:13 PMghedeon
01/31/2020, 6:50 PMuiState
LiveData (maybe another one for events) and never looked back.Hakob Astvacatryan
01/31/2020, 11:44 PMghedeon
01/31/2020, 11:49 PMHakob Astvacatryan
01/31/2020, 11:56 PMghedeon
01/31/2020, 11:59 PMwhen
block grows with scale, not the complexity of LiveData. Plus, in a good architecture logic is isolated in independent units, maybe custom views in your case. As long as every unit knows how to render it's own "complex" state, the composition of all states is a trivial taskDaniel
02/01/2020, 10:58 PMDaniel
02/01/2020, 11:00 PMViewState
approach: This falls down when you need to have one off events (SingleLiveData) and normal LiveData. So I personally like to keep the flexibility of separate LiveDataghedeon
02/02/2020, 9:02 AMursus
02/02/2020, 2:10 PMursus
02/02/2020, 2:11 PMursus
02/02/2020, 2:11 PMursus
02/02/2020, 2:12 PMursus
02/02/2020, 2:14 PMursus
02/02/2020, 2:15 PMHakob Astvacatryan
02/02/2020, 2:15 PMHakob Astvacatryan
02/02/2020, 2:16 PMursus
02/02/2020, 6:24 PMmiqbaldc
02/16/2020, 5:16 PMHakob Astvacatryan
02/17/2020, 1:55 PM