What is preferable... to pass the full uiState as ...
# compose
p
What is preferable... to pass the full uiState as a parameter to a composable that requires various uiState parameters? or to pass all the parameters separatedly from the uiState? The second option makes my call very huge, and if I need to call the same composable multiple times (for example for different orientations), it makes it tedious. For example, and having in mind that UiState haves these 6 variables plus X other more variables which are not being used in the next composable:
Copy code
RouteMapPanel(
    simpleMapCenterLocation = uiState.simpleMapCenterLocation,
    selectedLocation = uiState.selectedLocation,
    selectedLocationAddress = uiState.selectedLocationAddress,
    originLocation = uiState.originLocation,
    destinationLocation = uiState.destinationLocation,
    hasLocationPermission = uiState.hasLocationPermission
)
vs
Copy code
RouteMapPanel(uiState = uiState)
c
☝️ 1
p
unfortunatelly it was lost in the channel with only one single person participating
I'm trying to find more opinions and added a better sample
p
do you know how can a disscusion be bumped to make it visible again without making another post?
c
From my Point of view, you don’t get much traction on your questions because they are to general. We discuss the Kotlin programming language here and not design patterns and architecture.
Also check the link I posted, there is your answer according to Google.
> By not having wrapper classes you’re also more likely to pass composables only the parameters they need, which is a best practice.
To bump it, you could use the “send to channel” with a message.
p
interesting, didn't know that trick
also, thank you too for link with official google posture with this