Fork me on GitHub

Is there an example online of using reitit with frontend easy and reframe. Like as a project?


I’ve gone through the learn re-frame course and I’m having a little bit of trouble grokking the changes with using reitit


Likewise I’m also interested in the controllers and how that looks on a larger project than a sample file

Toni Vanhala13:11:44

The basic recipe how I’ve used reitit with re-frame is to • provide to reitit.frontend.easy/start! a dispatch fn, on-navigate, that swaps the new matching route to app-db when route changes. Route controllers are part of route data and they are applied during this dispatch. • add a key (e.g., :view) to route data, that has a value of the actual rendered view fn (reagent component) • make subscription to active route in app-db and pull out the :view to render • make a re-frame event and effect which performs the navigation when the event is dispatched

Toni Vanhala13:11:41

Currently writing a tutorial on reitit. Use with re-frame could be an “advanced” topic there.

👍 4
parrot 4

Share the link when you finished your post.

Toni Vanhala13:11:52

This seems to have all the bits and pieces from above, incl. controllers


This is super helpful. Thanks!


Can someone explain how the path conflicts work? How are these conflicting?


@grounded_sage If you route for /bulk/orders, it would match multiple routes.


Oh yep I can see that now


I think I was confused by the errows

;    /:user-id/orders
; -> /public/*path
; -> /bulk/:bulk-id


Which looks like it is saying those are the conflicting paths


In my code this conflicted. Which made me look at the docs. I'm not sure how that can conflict with the paths.



@grounded_sage those are not conflicting, unless there is a wildcard route which conflicts those both. But you can always disable the conflict resolution, it's just a shout-out about weird stuff, many times valid because of legacy reasons