-
How could we utilise the package to route through different levels of navigation of different feature modules. Let's say for example we have: A link like my-app-name://home/info/helpCentre?helpTicketId=1
The idea here is we would not want to expose these routes to the outside and they would be internal to the module. We would therefore want to I guess parse just the required info and pass the rest to the next module. For example we parse off the path related to AppRoute then pass the rest to HomeRoute, HomeRoute then parses just enough to identify that it needs to present InfoFeature and passes the rest to InfoFeature which in turn presents the final screen. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
This is definitely possible. You'll want to nest your routes: enum AppRoute {
case discover
case home(HomeRoute) ⬅️
case settings
}
enum HomeRoute {
case similarProducts
case info(InfoRoute) ⬅️
}
enum InfoRoute {
case termsAndConditions
case helpCentre(helpTicketId: Int)
} And then you can nest your routers: let infoRouter = OneOf {
...
}
let homeRouter = OneOf {
Route(HomeRoute.info) {
Path { "info" }
infoRouter
}
...
}
let appRouter = OneOf {
Route(AppRoute.home) {
Path { "home" }
homeRouter
}
...
} And that allows you to put the route enum and router into a feature module. We demonstrated this in detail in the 2nd part of our modularization series: https://www.pointfree.co/episodes/ep172-modularization-part-2 |
Beta Was this translation helpful? Give feedback.
This is definitely possible. You'll want to nest your routes:
And then you can nest your routers:
And that allows you to put the route enum and router into a feature module.
We demonstrated this in detail in the 2nd part of ou…