This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-02
Channels
- # aleph (3)
- # announcements (2)
- # babashka (4)
- # beginners (74)
- # calva (21)
- # clj-kondo (30)
- # cljs-dev (7)
- # cljsrn (42)
- # clojure (121)
- # clojure-dev (13)
- # clojure-europe (23)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-spec (140)
- # clojure-uk (58)
- # clojuredesign-podcast (9)
- # clojurescript (49)
- # clojutre (2)
- # cursive (32)
- # datascript (2)
- # datomic (59)
- # duct (7)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (5)
- # jackdaw (1)
- # joker (6)
- # juxt (7)
- # leiningen (9)
- # off-topic (1)
- # pedestal (14)
- # quil (2)
- # re-frame (3)
- # reitit (8)
- # shadow-cljs (78)
- # sql (8)
- # timbre (3)
- # vim (69)
I have a key I want to set like so :foo.api/origin #duct/env ["FOO_ORIGIN" Str]
and then reference in other components, but I don’t have any initialization to do for foo.api/origin
, it is effectively just capturing the env var and propagating it out to other components. Is there a better way to do this than an init-key that’s a no-op?
I've never found a satisfactory way of referencing keys in duct config without making those keys full integrant keys. What I've ended up doing instead is putting what I want to reuse into a "snippet" edn file and then #duct/include
ing it wherever I want to reuse it. That would probably be overkill for you though in your case - easier just to reference the env var in multiple places instead.
Would be interested to hear if other folks have found a cleaner way of doing it though.
I found this: https://github.com/duct-framework/duct/issues/96 It looks like you could put {:foo.api/origin [:duct/const]} in your duct_hierarchy.edn to avoid writing an init-key method
@U1UEABW4W nice!