https://kotlinlang.org logo
#compose
Title
# compose
k

Kevin Del Castillo

05/10/2022, 1:30 PM
Hey everyone 👋 how do you usually handle your higher composables (let's say a whole screen content) when that composable has a lot of parameters?
k

Kevin Del Castillo

05/10/2022, 2:27 PM
Oh, that's true, I remember reading that a while ago, but totally forgot about it now, thanks 🙏
l

Landry Norris

05/10/2022, 4:20 PM
I usually use interfaces to define functions, then implement with a class. Also helps with previews and testing and makes it more modular (if I see that the same composable can be reused, but different behaviour, I can make another class that implements the interface.
k

Kevin Del Castillo

05/10/2022, 4:23 PM
I believe state holders can also be used without issue in previews since they should only contain states, not flows or anything that's related to the business logic, I think I've also seen interfaces used as states, but I think their use case is different, since it adds an unnecessary extra layer