Getting events from child components #204
Answered
by
arkivanov
serhiynovos
asked this question in
Q&A
-
Is it good idea to use callbacks to get events from child component ? For example we have next components structure
Then for Root component I define next child factory private fun createChild(
config: Config,
componentContext: ComponentContext
): Root.Child = when (config) {
is Config.Authorization -> Root.Child.AuthorizationChild(
component = AuthorizationComponent(
componentContext = componentContext,
storeFactory = storeFactory,
mainContext = Dispatchers.Main,
onAuthSuccess = {
// Replace authorization page by main page
}
)
)
} In my project I want to use coroutines, so maybe there are better ways how to achieve it ? |
Beta Was this translation helpful? Give feedback.
Answered by
arkivanov
Sep 11, 2022
Replies: 1 comment 6 replies
-
Yes it's a good idea. Should work just fine. |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
serhiynovos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes it's a good idea. Should work just fine.