This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-30
Channels
- # asami (10)
- # babashka (14)
- # beginners (71)
- # calva (56)
- # cider (8)
- # cljs-dev (3)
- # clojure (111)
- # clojure-australia (1)
- # clojure-europe (19)
- # clojure-nl (4)
- # clojure-uk (147)
- # clojurescript (4)
- # cursive (8)
- # datalog (1)
- # datomic (19)
- # emacs (4)
- # graalvm (32)
- # helix (14)
- # jackdaw (7)
- # jobs-discuss (10)
- # juxt (4)
- # lsp (3)
- # malli (47)
- # meander (6)
- # off-topic (29)
- # portal (6)
- # re-frame (1)
- # react (3)
- # reitit (24)
- # releases (1)
- # remote-jobs (4)
- # reveal (33)
- # rewrite-clj (3)
- # shadow-cljs (5)
- # sql (10)
- # tools-deps (4)
- # vim (7)
- # xtdb (151)
ok I was passing data on the wrong place
now I just need a way to hot reload files
I have a question about reitit
... if I have routes defined like:
/a
/a/b
Is it possible to arrange controller functions for :start
and :stop
in a sort of hierarchal fashion, so that :stop
doesn't get called for /a
unless I navigate entirely away from /a
?
I think part of my problem is that I don't quite understand how push-state
is to be used in the case of nested routes.
Every time I nest something beneath one my routes, the route above it becomes invalid.
["/a" {:controllers [a-controller]}
["" {:view :a-view}]
["/b" {:controllers [b-controller] :view :b-view}]]
This should work.Yes, thank you - I just simultaneously figured that out (once I understood how to get reitit to tell me what the combined/collapsed routes were, it became obvious).
However, it looks like in my particular case, the controller behavior I had been hoping for doesn't really occur.
Ok yes indeed that does work. My renderer is weird since the controllers themselves are what create the side effects that get rendered, so it breaks in a slightly different way with the ""
route, but that's for me to fix, and should definitely be possible. Thank you for the nice concise example - it was very helpful @juhoteperi.
Yeah. I usually use the route :view
data to control what is rendered and controllers just trigger data loads and the side effects.
Or instead of :view
name, I could have the view function on the routes directly. Or a var to get better dev experience.
Hi! I want to use anything kinda ring.middleware.reload
to avoid having to restart my server when I change something in the source code. Any ideas of how to do it with reitit?
In ring-router
(https://cljdoc.org/d/metosin/reitit/0.5.12/doc/ring/ring-router), for your second argument, specify wrap-reload as a middleware:
{:data
{:middleware [ring.middleware.reload/wrap-reload]}}
Wow, so it was just that, it worked, tks a lot
Sorry for the stupid question haha 😅