https://kotlinlang.org logo
#ballast
Title
# ballast
a

Adrian Witaszak

02/13/2023, 3:06 PM
In my component, usually, the Inputs file gets quite long. I already use separate use cases to make it shorter. What's your recommended way of keeping logic in Ballast components?
c

Casey Brooks

02/13/2023, 3:11 PM
THere was a similar thread on this topic, see my recommended solution there https://kotlinlang.slack.com/archives/C03GTEJ9Y3E/p1673011075182379
a

Adrian Witaszak

02/13/2023, 3:16 PM
I already use this approach with extensions on InputHandlerScope and typealias to make it shorter 🙂
c

Casey Brooks

02/13/2023, 3:39 PM
Yeah, I’d encourage you to just keep playing around with different syntax/boilerplate for your VMs to figure out what works the best for your team. As with most things, the more you get familiar with it, the more you get to know when and how to break the rules to fit your needs. And just speaking as the library developer, I’m most interested in shaping the problem and solution for more simple use-cases, especially things that are just slightly non-trivial to emphasize the need for Ballast and state management in general. The opinionated part is to help folks understand why a more rigid structure like MVI is necessary. But as apps/VM grow in size, I’d rather leave it up to the users to decide what works best for their teams