levibostian / AndroidBlanky

Create a new Android app fast. Comes pre-installed with libraries you already use.
7 stars 0 forks source link

some confusion about injection in the application? #79

Closed gatspy closed 2 years ago

gatspy commented 3 years ago

why ReposTellerRepository ReposRepository UserManager and so on are not injecting dependencies in the DependencyModule?

levibostian commented 3 years ago

Hey there, @gatspy

Are you asking if dependencies such as UserManager are inserted into the dependency graph of my app?

You don't need to add dependencies to modules. You can also @Inject a constructor of your class:

class UserManager @Inject constructor(private val keyValueStorage: KeyValueStorage) {
                                 ^^^^^^

I only add classes to DependencyModule that are 3rd party dependencies that I can't use @Inject on.

Does that answer your question?