This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-12
Channels
- # aleph (1)
- # announcements (13)
- # asami (4)
- # babashka (47)
- # beginners (22)
- # calva (11)
- # circleci (1)
- # clj-kondo (14)
- # clojure (43)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-uk (6)
- # clojurescript (13)
- # core-async (5)
- # cursive (8)
- # datomic (20)
- # events (3)
- # fulcro (12)
- # graalvm (1)
- # graphql (4)
- # gratitude (3)
- # java (2)
- # juxt (2)
- # leiningen (12)
- # off-topic (30)
- # pathom (33)
- # pedestal (5)
- # podcasts (1)
- # polylith (14)
- # rdf (2)
- # re-frame (12)
- # reagent (3)
- # releases (2)
- # shadow-cljs (24)
- # spacemacs (13)
- # sql (2)
- # tools-build (16)
I have a form 3 component, a function that returns a function that returns hiccup. The outer function needs argument A, while the inner function needs arguments B and C:
(defn example [a b c]
(let [result (other-call a)]
(fn [a b c]
[:div result [other-component b c]])))
Do I need to define a
and b
and c
in both functions? is there a way to avoid it?Yes. No.
If you don't want to see linter warnings about unused symbols, just add _
in front of their name, like _b
. Or just replace the names with _
altogether.
Alternatively, you can put them all in a single map and destructure only what's needed, like {:keys [a]}
in the outer fn and {:keys [b c]}
in the inner one.
👍 1