In an Android + iOS multiplatform app using MVVM w...
# multiplatform
l
In an Android + iOS multiplatform app using MVVM with a Repository layer in between ViewModel and data layers, is it better to call CoroutineScope.launch { } in order to get a list of displayable data in the 1. ViewModel layer, or in the 2. Repository layer?
a
I vote for 1st case just because coroutine scope lifetime will depends on viewModel’s lifycycle and on UIViewController / Activity on native side. In repositories you’ll have global, unbreakable scopes I think
l
Yes, very smart! Thanks!