You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
790 B

package com.ballast.shoppe.feature.router
import com.copperleaf.ballast.EventHandler
import com.copperleaf.ballast.EventHandlerScope
import com.copperleaf.ballast.navigation.routing.RouterContract
internal class RouterEventHandler :
EventHandler<RouterContract.Inputs<RouterScreen>, RouterContract.Events<RouterScreen>, RouterContract.State<RouterScreen>> {
override suspend fun EventHandlerScope<RouterContract.Inputs<RouterScreen>, RouterContract.Events<RouterScreen>, RouterContract.State<RouterScreen>>.handleEvent(
event: RouterContract.Events<RouterScreen>,
) {
when {
event is RouterContract.Events.BackstackEmptied ->
postInput(RouterContract.Inputs.GoToDestination(RouterScreen.Home.matcher.routeFormat))
}
}
}