Vaibhav Jaiswal
01/25/2024, 11:42 AMAuthComponent
and from androidMain, i provide a few components in a List
and the same from iOSMain
Like List<AuthComponent>
And show all of them in a list inside a Component say LoginComponent
, in this we inject the authComponents using Koin and display all
How can I achieve this?
I went through SlotNavigation, but does not seem it can work with a list of components
UseCase:
All Login buttons are a Decompose component, injected from androidMain and iosMainArkadii Ivanov
01/25/2024, 11:46 AMVaibhav Jaiswal
01/25/2024, 11:47 AMVaibhav Jaiswal
01/25/2024, 11:48 AMAuthComponent
which starts the login flowArkadii Ivanov
01/25/2024, 11:58 AMclass LoginComponent(
componentContext: ComponentContext,
authComponentsFactory: AuthComponentsFactory,
) : ComponentContext by componentContext {
val authComponents: List<AuthComponent> =
authComponentsFactory { key -> childContext(key = key) }
}
fun interface AuthComponentsFactory {
operator fun invoke(ctx: (key: String) -> ComponentContext): List<AuthComponent>
}
Vaibhav Jaiswal
01/25/2024, 12:17 PMget<List<AuthComponents>> { parametersOf(ctx("some key") }
Vaibhav Jaiswal
01/25/2024, 12:17 PMArkadii Ivanov
01/25/2024, 12:18 PMVaibhav Jaiswal
01/25/2024, 12:19 PM