Adam Brown
when
fun ProjectSelectionUi( component: ProjectSelection, modifier: Modifier = Modifier ) { val slot by component.slot.subscribeAsState() when (val destination = slot.child?.instance) { is ProjectSelection.Destination.AccountSettingsDestination -> AccountSettingsUi( destination.component, modifier ) is ProjectSelection.Destination.ProjectsListDestination -> ProjectListUi( destination.component, modifier ) else -> throw IllegalArgumentException("Child cannot be null") } }
Arkadii Ivanov
A modern programming language that makes developers happier.