```private val repository = DataRepository() priva...
# coroutines
m
Copy code
private val repository = DataRepository()
private val viewModelJob = SupervisorJob()
private val viewModelScope = CoroutineScope(Main+viewModelJob)
val mNowPlayingDataLiveData = MutableLiveData<NowPlayingMovies>()

fun DataFromrepository(page :Int){
    viewModelScope.launch {
                 val response = repository.getDataFromServer(page)

        if(response.isSuccessful){
                     mNowPlayingDataLiveData .value = response.body()
}}
v
But my viewmodel scope is calling the network API so do u think using a Main Dispatcher a good idea ?