Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Last active August 6, 2020 15:20
Show Gist options
  • Select an option

  • Save catalinghita8/e725b5e9fc44408a54071c47b112d9e5 to your computer and use it in GitHub Desktop.

Select an option

Save catalinghita8/e725b5e9fc44408a54071c47b112d9e5 to your computer and use it in GitHub Desktop.
class ViewModel(private val repository: Repository) {
fun doSomething() {
repository.use()
}
}
class Repository(private val objectA, private val objectB: B) {
fun use() {
objectA.use()
objectB.use()
}
}
fun main {
val vm = ViewModel(Repository(A(), B())
vm.doSomething()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment