Dagger: start setup

This commit is contained in:
ganfra
2022-12-09 19:27:04 +01:00
parent 32dbaaf836
commit cb92ff5d3b
22 changed files with 290 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
/build
+7
View 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<*>,
)