ViewModel

ViewModel

open class ViewModel

Fields

Name Description
val viewModelJob: /** * This is the job for all coroutines started by this ViewModel. * Cancelling this job will cancel all coroutines started by this ViewModel. */

This is the job for all coroutines started by this ViewModel. Cancelling this job will cancel all coroutines started by this ViewModel.

val uiScope: /** * This is the main scope for all coroutines launched by MainViewModel. * Since we pass viewModelJob, you can cancel all coroutines * launched by uiScope by calling viewModelJob.cancel() */

This is the main scope for all coroutines launched by MainViewModel. Since we pass viewModelJob, you can cancel all coroutines launched by uiScope by calling viewModelJob.cancel()

Constructors

Name Description
constructor()