Liking cljdoc? Tell your friends :D

Update key

(ns darkleaf.di.tutorial.x-update-key-test
  (:require
   [clojure.test :as t]
   [darkleaf.di.core :as di]))

In most cases you just want to instrument or update one dependency.

(def route-data [])

(defn subsystem-a-route-data
  {::di/kind :component}
  [-deps]
  ["/a"])

(t/deftest update-key-test
  (with-open [root (di/start `route-data
                             (di/update-key `route-data conj
                                            (di/ref `subsystem-a-route-data)
                                            ["/b"]
                                            nil)
                             {})]
    (t/is (= [["/a"] ["/b"] nil] @root))))

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close