Created
April 21, 2023 03:38
-
-
Save cjbrooks12/d6934cfcb4e38ee3293e14d19007066d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class AppScreen( | |
routeFormat: String, | |
override val annotations: Set<RouteAnnotation> = emptySet(), | |
) : Route { | |
Home("/app/home"), | |
PostList("/app/posts?sort={?}"), | |
PostDetails("/app/posts/{postId}"), | |
; | |
override val matcher: RouteMatcher = RouteMatcher.create(routeFormat) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IosRouterViewModel() : IosViewModel< | |
<RouterContract.Inputs<AppScreen>, | |
RouterContract.Events<AppScreen>, | |
RouterContract.State<AppScreen> | |
>( | |
config = BallastViewModelConfiguration.Builder() | |
.withRouter(RoutingTable.fromEnum(AppScreens.values()), AppScreens.Home) | |
.build(), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment