abbic
02/19/2023, 8:48 PMclass RouterViewModel(
viewModelCoroutineScope: CoroutineScope
) : BasicRouter<AppRoutes>(config = BallastViewModelConfiguration.Builder())
there's an error on BasicRouter because the <init> is private on BasicViewModel. additionally it claims to not find the config field. Clearly this is strange as BasicViewModel has a public secondary constructor defined right there where i can see it. am on ballast 2.3.3abbic
02/19/2023, 9:05 PMabbic
02/19/2023, 9:08 PMCasey Brooks
02/20/2023, 4:45 PMeventHandler
parameter does not have a default value). It does not require all parameters to be specified, just the ones without default valuesabbic
02/20/2023, 4:46 PMabbic
02/20/2023, 4:47 PMconfig =
did not seem to make the compiler understand the constructor it was working withabbic
02/20/2023, 4:47 PMCasey Brooks
02/20/2023, 4:49 PMCasey Brooks
02/20/2023, 4:54 PMRoute
and RoutingTable
are both pretty interfaces, and you could probably make it work to define your routes with sealed classes if you’d like. I haven’t tried it though, so I don’t know the full extent of what would be required.
The reason it is not offered out-of-the-box is that there is no way to automatically enumerate all sub-classes of a sealed class, so you’d need to manually build the list of routes to pass to the routing table. The only way to automatically build a list of routes without reflection or code generation is with an enum.abbic
02/20/2023, 5:02 PM