Hey I have a question about compose,
if I have a complex screen with many states, like
• Some permissions need to be granted to show any UI
• UI loading
• UI error
• etc
What is the best practise? Like defining a master state data class (with many constructor arguments) and pass it from top to bottom, where I pass the events from bottom to top?
I read that passing viewModel it self as method argument in composable is not a good practise since this would imply states within the composable method
d
dewildte
10/18/2021, 7:38 PM
This could be a
sealed class/interface
or you could have a “status”
enum
as part of your state.
dewildte
10/18/2021, 7:39 PM
But this question is not Compose or Kotlin related so I imagine somebody is going to point that out soon.
dewildte
10/18/2021, 7:40 PM
They might say something like “architecture is beyond the scope of this channel.”
m
mingkangpan
10/19/2021, 6:39 AM
Hey, thanks for your answer.
Where else could I ask this question then?
d
dewildte
10/19/2021, 2:37 PM
I suggest doing more research related to State management.