Last active
November 19, 2018 01:03
-
-
Save marenovakovic/d7e016f9fb91a27b69c52ddbecdb7722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.marko.presentation.base | |
import androidx.lifecycle.ViewModel | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.Job | |
import kotlin.coroutines.CoroutineContext | |
abstract class BaseViewModel : ViewModel(), CoroutineScope { | |
private val job = Job() | |
override val coroutineContext: CoroutineContext | |
get() = Dispatchers.Main + job | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment