Liking cljdoc? Tell your friends :D

2.4.2

Fixing di/add-side-dependency

2.4.1

Fixing di/add-side-dependency

When root had eight dependencies a system with side depencency started up in the wrong order.

2.4.0

Starting many keys as a map

Now you can pass a map as the key argument to start many keys:

(t/deftest lookup-test
  (with-open [root (di/start {:a `a :b `b})]
    (let [{:keys [a b]} root]
      (t/is (= :a a))
      (t/is (= :b b)))))

2.3.0

Env parsing

With di/env-parsing middleware, you can add env parsers.

(defn jetty
  {::di/stop (memfn stop)}
  [{port    :env.long/PORT
    handler `handler
    :or  {port 8080}}]
  (jetty/run-jetty handler {:join? false
                            :port port}))

(di/start `jetty (di/env-parsing {:env.long parse-long}))

2.2.0

Multimethods as services

Now you can define a service with a multimethod:

(defmulti service
  {::di/deps [::x]}
  (fn [-deps kind] kind))

2.1.0

Starting many keys

Now you can pass a vector as the key argument to start many keys:

(with-open [root (di/start [`handler `helper])]
  (let [[handler helper] root]
     ...))

2.0.0

Base version.

1.x

Don't use it. I forgot the details.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close