This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-17
Channels
- # announcements (2)
- # aws (4)
- # babashka (20)
- # beginners (256)
- # calva (15)
- # chlorine-clover (1)
- # cider (12)
- # clj-kondo (25)
- # cljsrn (16)
- # clojure (115)
- # clojure-europe (7)
- # clojure-finland (5)
- # clojure-italy (10)
- # clojure-nl (35)
- # clojure-spec (13)
- # clojure-uk (83)
- # clojurescript (42)
- # code-reviews (81)
- # conjure (8)
- # cursive (6)
- # data-science (1)
- # datomic (3)
- # duct (18)
- # emacs (2)
- # figwheel-main (40)
- # fulcro (21)
- # helix (1)
- # jackdaw (7)
- # java (2)
- # lein-figwheel (5)
- # luminus (1)
- # observability (12)
- # off-topic (32)
- # parinfer (5)
- # pedestal (19)
- # re-frame (5)
- # reagent (8)
- # reitit (17)
- # rewrite-clj (47)
- # rum (19)
- # shadow-cljs (48)
- # spacemacs (4)
- # sql (40)
- # tools-deps (22)
- # vrac (1)
- # xtdb (25)
Hi, can we specify :coercion
(malli) per route instead of router-wide? [["/a" {:name ::a :coercion with-string-coercion ....}] ["/b" {:name ::b :coercion with-custom-coercion ....}]]
@funyako.funyao156 yes. it’s just route data and accumulates normally (using meta-merge)
the last (nearest to the leaf) wins by default, but you can use meta-merge hints to change how the merging works.
You are lucky, instead of me 🙂 But I'v found a solution by myself with nested routes & merging data
I have a match object, and a router (context is front end) and I want to add some query parameters (to reflect user interaction). I can make do by plucking things out of the match object but I’m not sure if there isn’t a better way?
Do you want to update the address bar according to some app state changes or something else?
I fiddled with something like this a while ago. I think eventually I ended up adding the params to the url somehow manually and then letting reitit controllers trigger changes to app state based on the params. I’m not sure if it’s the best way to do it but it works.. if I remember correctly. I’m not at the computer now and can’t check
Yeah, essentially reflecting the UI state in the address bar so that people can share URLs.
The issue is that it’s not all UI state, just that that describes the underlying DB query.
I would like to go through Reitit for simplicity but don’t want to hardcore the route name, and I have access to the match result.
I’m not 100% sure on the relationship between UI state and reitit controllers yet (if I want to leverage them or not), something to ponder.