There are cases when routes can share the same set of parameters (most likely search parameters and state fields). One common example is pagination params.
We likely want a common helper for these parameters as well, so we need an actual route for them.
We could use inheritance, but it can quickly get ugly: PAGINATION.FILTER.ORDER.ACTUAL_ROUTE.buildUrl(...).
We can use route types, but it's relatively verbose:
There are cases when routes can share the same set of parameters (most likely search parameters and state fields). One common example is pagination params.
We likely want a common helper for these parameters as well, so we need an actual route for them.
We could use inheritance, but it can quickly get ugly:
PAGINATION.FILTER.ORDER.ACTUAL_ROUTE.buildUrl(...)
.We can use route
types
, but it's relatively verbose:It would be nice to have an API for route composition, something like this:
However, I can't figure out how to write types for this (when there are multiple fragments).