Ive Vasiljevic
03/04/2019, 12:54 PMnicopasso
03/04/2019, 1:35 PMCoroutineScope
so it can use launch
scopes to run coroutines methods that are defined in the use case as suspend functions. The suspend functions then use return withContext(<http://Dispatchers.IO|Dispatchers.IO>) { // your api call }
to actually perform retrofit calls. The ViewModel then uses the returned value from the use case as a livedata that the activity observesIve Vasiljevic
03/05/2019, 8:57 AMnicopasso
03/05/2019, 9:21 AM