PhilippeBoisney / ArchApp

Simple Android app to show how to design a multi-modules MVVM Android app (fully tested)
624 stars 97 forks source link

Coroutines - job cancelation #3

Open maiconhellmann-n5 opened 5 years ago

maiconhellmann-n5 commented 5 years ago

I could not find any mechanism to cancel the requests in the ViewModels. Example DetailViewModel line 48: withContext(dispatchers.io) { userSource = getUserDetailUseCase(forceRefresh = forceRefresh, login = argsLogin) }

Is it the case to use androidx.lifecycle with viewModelScope(although still in alpha)? https://developer.android.com/jetpack/androidx/releases/lifecycle