Dagger: start setup
This commit is contained in:
parent
32dbaaf836
commit
cb92ff5d3b
22 changed files with 290 additions and 4 deletions
1
anvilannotations/.gitignore
vendored
Normal file
1
anvilannotations/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
7
anvilannotations/build.gradle.kts
Normal file
7
anvilannotations/build.gradle.kts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(libs.inject)
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package io.element.android.x.anvilannotations
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Adds view model to the specified component graph.
|
||||
* Equivalent to the following declaration in a dagger module:
|
||||
*
|
||||
* @Binds
|
||||
* @IntoMap
|
||||
* @ViewModelKey(YourViewModel::class)
|
||||
* public abstract fun bindYourViewModelFactory(factory: YourViewModel.Factory): AssistedViewModelFactory<*, *>
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class ContributesViewModel(
|
||||
val scope: KClass<*>,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue