Last active
June 15, 2020 06:15
-
-
Save saurabharora90/ffbcd1d04d5f4bff41c76296fd1c7cc0 to your computer and use it in GitHub Desktop.
Updated Dagger Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface AppComponent { | |
@Component.Factory | |
interface Factory { | |
fun create(@BindsInstance context: Context): AppComponent | |
} | |
..... | |
fun getInitializers(): Map<Class<out ModuleInitializer>, @JvmSuppressWildcards ModuleInitializer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module | |
abstract class InitializerModule { | |
@Binds | |
@IntoMap | |
@InitializerKey(CustomerCareInitializer::class) | |
abstract fun customerCareInitializer(initializer: CustomerCareInitializer): ModuleInitializer | |
@Binds | |
@IntoMap | |
@InitializerKey(SubscriptionInitializer::class) | |
abstract fun subscriptionInitializer(initializer: SubscriptionInitializer): ModuleInitializer | |
} | |
@MustBeDocumented | |
@Target(AnnotationTarget.FUNCTION) | |
@Retention(AnnotationRetention.RUNTIME) | |
@MapKey | |
annotation class InitializerKey(val value: KClass<out ModuleInitializer>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment