This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-13
Channels
- # announcements (2)
- # architecture (10)
- # aws (1)
- # babashka (1)
- # beginners (208)
- # calva (15)
- # clojure (164)
- # clojure-australia (9)
- # clojure-europe (37)
- # clojure-nl (19)
- # clojure-sanfrancisco (2)
- # clojure-spec (10)
- # clojure-taiwan (2)
- # clojure-uk (48)
- # clojurescript (59)
- # conjure (2)
- # core-async (3)
- # data-science (3)
- # datomic (5)
- # events (66)
- # figwheel-main (2)
- # fulcro (35)
- # graphql (3)
- # jobs-rus (3)
- # kaocha (1)
- # meander (5)
- # off-topic (85)
- # pedestal (2)
- # re-frame (5)
- # reitit (11)
- # reveal (5)
- # shadow-cljs (16)
- # slack-help (15)
- # test200 (4)
- # tools-deps (12)
- # xtdb (9)
Looks like my problem was solved by changing the parameters I pass to apply-controllers. I used the ::navigated event from the frontend-re-frame example
(re-frame/reg-event-db ::navigated
(fn [db [_ new-match]]
(let [old-match (:current-route db)
controllers (rfc/apply-controllers (:controllers old-match) new-match)] (assoc db :current-route (assoc new-match :controllers controllers)))))
I fixed it by passing (:controllers (:data old-match))
instead of (:controllers old-match)
I think it's a mistake in the example.Hi there. Is it normal to have form-params
as a map of strings to strings? If so, is there a nice way to convert the keys to keywords instead?
There’s middleware for that-- muuntaja.middleware/wrap-format
I think?
or maybe wrap-params
… It’s been a while since I’ve looked at the code.
So I'm using these 3:
;; content-negotiation
muuntaja/format-negotiate-middleware
;; encoding response body
muuntaja/format-response-middleware
;; decoding request body
muuntaja/format-request-middleware
but by the time it hits the handler the params
is still a map of strings to stringswe’ve got a function that looks like this:
(defn wrap-formats
[handler]
(-> handler
(wrap-params)
(wrap-format muuntaja-opts)))
It’s fairly high/early in our root middleware stack.