Create ContributesNode annotation to generate module and assistedFactory for node.
This commit is contained in:
parent
a37cf3adde
commit
4fb063654f
4 changed files with 165 additions and 27 deletions
|
|
@ -0,0 +1,23 @@
|
|||
package io.element.android.x.anvilannotations
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Adds Node to the specified component graph.
|
||||
* Equivalent to the following declaration:
|
||||
*
|
||||
* @Module
|
||||
* @ContributesTo(Scope::class)
|
||||
* abstract class YourNodeModule {
|
||||
|
||||
* @Binds
|
||||
* @IntoMap
|
||||
* @NodeKey(YourNode::class)
|
||||
* abstract fun bindYourNodeFactory(factory: YourNode.Factory): AssistedNodeFactory<*>
|
||||
*}
|
||||
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class ContributesNode(
|
||||
val scope: KClass<*>,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue