Fork me on GitHub
#reitit
<
2021-04-12
>
pmooser11:04:18

I'm having trouble understand how I can create a "default" route in reitit, when none of my other routes match. I'm trying to switch to this from secretary, but there's a lot I don't understand at this point.

ikitommi11:04:49

I don’t think there is an easy way in frontend routing for that. I think the whole frontend routing would need some extra ❤️ , could be simpler and smaller. I do not have time for that, but maybe others?

pmooser15:04:42

It seems like a common use case. It's nice to be able to ensure exhaustive handling in anything that's trying to enumerate all of the different types of URLs in an application.

pmooser17:04:49

Is there a way to retrigger navigation to the current URL?

pmooser17:04:04

Like act as if we did another push-state of the same value?

pmooser18:04:13

I ended up just forcing the controller to refire, which works for my case.

juhoteperi18:04:08

Hmh, I was quite sure there is default-handler for frontend, but it is indeed Ring only. I think it should still return a match, with nil name or something like that. I think that's how I'm checking for not-found view usually.

juhoteperi18:04:32

For retrigger, when using in a app with re-frame, the on-navigate callback only dispatches an event. If I need to retrigger the routing logic, I'll just dispatch that event with the current match from app-db. Usually that handles the parts that I want to trigger anyway.