Back

expand-key (clj)

(source)

multimethod

(expand-key key value)
Expand a config value into a map that is then merged back into the config. Defaults to returning a map `{key value}`. See: [[expand]].

Examples

integrant
(ns integrant.core-test
  (:require #?(:clj  [clojure.test :refer [are deftest is testing]]
               :cljs [cljs.test :refer-macros [are deftest is testing]])
            [integrant.core :as ig]
            [weavejester.dependency :as dep]))

(defmethod ig/expand-key ::mod   [_ v] {::a v, ::b {:v v}})
(defmethod ig/expand-key ::mod-a [_ v] {::a v})
(defmethod ig/expand-key ::mod-b [_ v] {::b {:v v}})
(defmethod ig/expand-key ::mod-c [_ v] {::c {:x {:y {:z v}}}})
(defmethod ig/expand-key ::mod-z [_ v] {::z v})