This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-14
Channels
- # announcements (1)
- # beginners (206)
- # calva (2)
- # cider (64)
- # cljs-dev (12)
- # clojars (2)
- # clojure (177)
- # clojure-europe (2)
- # clojure-finland (1)
- # clojure-italy (2)
- # clojure-losangeles (5)
- # clojure-nl (7)
- # clojure-russia (69)
- # clojure-spec (41)
- # clojure-uk (92)
- # clojurescript (60)
- # core-async (16)
- # cursive (48)
- # data-science (6)
- # datomic (73)
- # duct (5)
- # events (2)
- # figwheel-main (5)
- # fulcro (29)
- # hoplon (1)
- # off-topic (52)
- # pathom (11)
- # reagent (4)
- # reitit (5)
- # remote-jobs (1)
- # rum (7)
- # shadow-cljs (58)
- # slack-help (10)
- # spacemacs (3)
- # testing (3)
- # tools-deps (5)
Hello. I am trying to use clj-duration
in my config.edn, that means using a tag #unit/duration
in the EDN. Of course reading config throws an error:
Execution error at integrant.core/read-string (core.cljc:155).
No reader function for tag unit/duration
how do I resolve this? (if at all possible)
nvm found out where to put extra readers
Heh. I was just typing a reply in a scratch file before I saw that you’ve already found it. I’ll add the answer here anyway for others.
duct/read-config
has an optional readers argument which allows you to supply custom readers.
(def my-readers {'uri #(URI. %)
'duration my-duration-function}
;; ...
(duct/read-config (io/resource "blah/blah/config.edn")) my-readers)
You’ll need modify your calls to read-config
wherever it is used, which would typically be within main.clj
and dev.clj
in a vanilla Duct app. 10