Skip to content

Inheritance in custom ComponentContext since 3.0.0-alpha09 and childFactory #679

Answered by arkivanov
malliaridis asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, in this case it requires some more code.

interface AppComponentContextDependencies {
    val thing: String
}

interface AppComponentContext : GenericComponentContext<AppComponentContext>, AppComponentContextDependencies

class DefaultAppComponentContext(
    delegate: GenericComponentContext<*>,
    override val thing: String,
) : AppComponentContext,
    LifecycleOwner by delegate,
    StateKeeperOwner by delegate,
    InstanceKeeperOwner by delegate,
    BackHandlerOwner by delegate {

    override val componentContextFactory: ComponentContextFactory<AppComponentContext> =
        ComponentContextFactory { lifecycle, stateKeeper, instanceKeeper, backHandler ->
            DefaultA…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@malliaridis
Comment options

@arkivanov
Comment options

Answer selected by malliaridis
@arkivanov
Comment options

@malliaridis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants