Open ivan-suhorukov opened 8 months ago
Is it better just pass URL to router.open(url)
?
Defining function looks like pretty complex thing.
router.open(url)
uses hard-coded url`s, so maybe better to user $router as a one source of truth?
When i change the route then, i dont need to change all of the router.open(url)
calls.
When i change the route then, i dont need to change all of the router.open(url) calls.
Do you really often change URLs?
We can add this feature, let’s see how many bytes it takes and how it will affect complexity of types and logic.
What is the recommended workaround? It seems that I can't use regexp routes if I want to do any redirects to that route. In my case the route with a regexp is my default route, so I redirect any invalid route to it.
@schwiet just use router.open()
with manually written URL.
If you want to change API you need to help and send PR.
Now, when i use a RegExp routes, i cannot use
openPage
orredirectPage
functions. Router throwsRegExp routes are not supported
. So may be we can support this by adding second converter to route? Something like this:So router can determine the redirect url and do redirect?