Last active
April 20, 2019 13:26
-
-
Save RBusarow/422364126bf1c6412ae3d0238cf38a49 to your computer and use it in GitHub Desktop.
Injecting a CoroutineScope into a ViewModel using a common viewModelFactory lambda
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
viewModelFactory { | |
val scope = SupervisorCoroutineScope(Dispatchers.Default) | |
MyViewModel(MyRepository(scope), scope) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment