Created
June 11, 2024 21:54
-
-
Save ursusursus/4752ac4be5c3fe5743877a9a84ae68ee to your computer and use it in GitHub Desktop.
This file contains 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
@AppScope | |
@Component | |
interface AppComponent { | |
val userComponentFactory: UserComponent.Factory | |
@Component.Factory | |
interface Factory { | |
fun create(@BindsInstance context: Context): AppComponent | |
} | |
} | |
@UserScope | |
@Subcomponent | |
interface UserComponent { | |
val parent: AppComponent | |
val subscriberComponentFactory: SubscriberComponent.Factory | |
@Subcomponent.Factory | |
interface Factory { | |
fun create(@BindsInstance userId: UserId): UserComponent | |
} | |
} | |
@SubscriberScope | |
@Subcomponent | |
interface SubscriberComponent { | |
val what: UserComponent .... makes compile Stackoverflow | |
@Subcomponent.Factory | |
interface Factory { | |
fun create(@BindsInstance subscriberId: SubscriberId): SubscriberComponent | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment