Fork me on GitHub
#reitit
<
2019-11-21
>
grounded_sage12:11:35

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

grounded_sage12:11:27

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

grounded_sage12:11:02

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
papachan13:11:40

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

grounded_sage16:11:48

This is super helpful. Thanks!

grounded_sage18:11:25

Can someone explain how the path conflicts work? https://cljdoc.org/d/metosin/reitit-frontend/0.3.10/doc/basics/route-conflicts#path-conflicts How are these conflicting?

ikitommi18:11:56

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

grounded_sage18:11:09

Oh yep I can see that now

grounded_sage18:11:16

I think I was confused by the errows

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

grounded_sage18:11:26

Which looks like it is saying those are the conflicting paths

grounded_sage18:11:13

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

["projects"]
["project/:id"]

ikitommi19:11:05

@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