Last active
January 3, 2020 09:18
-
-
Save mlykotom/8bcf2835ef702036d4c149d2fab3eeb9 to your computer and use it in GitHub Desktop.
Connecting The Dots :: Motivation - manually added dependencies
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
class SomeViewModel( | |
private val dep1: Dependency, | |
private val dep2: Dependency2, | |
private val articleId: String | |
) : ViewModel() { | |
class Factory constructor( | |
private val dep1: Dependency, | |
private val dep2: Dependency2, | |
private val articleId: String | |
) : ViewModelProvider.Factory { | |
override fun <T : ViewModel?> create(modelClass: Class<T>): T { | |
return SomeViewModel(dep1, dep2, articleId) as T | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment